Phase 2, week 3. Who's there?

Phase 2, week 3. Who's there?

This week's goal for Zodiac Zingers, as I mentioned in my previous post, was to install visitors statistics/analytics tool.

10 years ago, I would choose Google analytics without having a second thought. These days are long gone.

First, as it (unfortunately) happens to some other Google products, you don't expect the new version to be an improvement anymore. Instead, you hope the new version to be not worse than the previous one. And this hope not always comes true.

Second, having in mind user privacy and consent, it is more convenient to self-host the analytics and avoid transferring any user data to the third parties.

Third, the central idea of #ZodiacZingers challenge was to try as many new things as possible.

I was looking for a free, self-hosted web analytics tool, that has some consent management, preferably installable as a Drupal module.

Welcome to Matomo (previously Piwik),

Google Analytics alternative that protects your data and your customers' privacy

(I wish all the sites have their purpose stated that clear)

Matomo has an accompanying Drupal module and a whole ecosystem of modules extending its functionality. There are 2 versions: hosted and on premise (self-hosted), and we will use the second one. That should be straightforward, using official Docker image.

The quicker path would be to define one-off additional service in ddev configuration, but I decided to create a ddev plugin, to make it easier for the people who'd like to try self-hosted Matomo with their ddev projects.

Writing a ddev plugin was an interesting experience that deserves its own blog post (maybe some day!), but for now, let's jump to the part where the plugin can be downloaded from https://github.com/valthebald/ddev-matomo with

ddev add-on get valthebald/ddev-matomo        

(maybe one day it becomes stable enough and I dare ask Randy Fay to include it to the list of officially supported ddev plugins)

The installation itself was straightforward, so I enabled Matomo module in Drupal, pointed it to the new service (https://matomo.zodiaczingers.ddev.site locally) and Website ID 1 and visited the home page as anonymous user.


Sets cookie by default

Hm. There are some cookies that I haven't agreed to be set. This is not good.

Luckily, Matomo takes user consent seriously, and there is a documentation page on how to configure the tool with different consent managers.

It was good to see Klaro among supported consent managers, as it's likely to become recommended way to manage user consent in the upcoming Drupal CMS. Even better, it is possible to configure Matomo to not use cookies at all, which I did until I figure things with Klaro:

Now, let's see what happens in Matomo dashboard. I've visited the site from different devices on my household, using landline and mobile connections, but all of them are suddenly detected as coming from the US. What's that?

After some digging on the Matomo website (great resource and vibrant community!) I found that the issue comes from missing geoip database:


and the fix was suggested by configuration page itself.

Now, I have the database, and see visitors from the US, China and Bulgaria (finally :) ) Another goal accomplished.

The goal for this week? Make it possible to move the whole series of blog posts to the site itself. Let's see how that goes. Stay tuned!

Week 4


Vasyl Yaremchuk

Independent Solution Engineer | Drupal and WordPress Developer | Symfony, Laravel, Vanilla PHP | React, Vanilla JS | Tailwind CSS | StoryBook

3 个月

yeah, many years ago we set Piwik, because the client objected to pass any information and statistics to 3rd party. At that time I thought that it was paranoia, but now I can see that he was a visioner. The existing news is that we now have Drupal integration!

要查看或添加评论,请登录

Valery Lourie的更多文章

  • PHP was designed to die

    PHP was designed to die

    Latest #WordPressDrama has triggered another wave of predictions of near PHP death (and as a conclusion, suggestions to…

    2 条评论
  • Phase 2, week 4. Decision fatigue

    Phase 2, week 4. Decision fatigue

    (Image courtesy https://desktime.com/, distributed under Creative Commons) Disclaimer 1: This is the second version of…

    2 条评论
  • Phase 2, week 2. Spread the word

    Phase 2, week 2. Spread the word

    Last week I fixed the site's homepage, changing it from a single horoscope card of the current sign (Scorpio as in…

  • Phase 2, week 1. Man in the middle

    Phase 2, week 1. Man in the middle

    How it all begun. "Man in the middle" could be my personal motto when it comes to politics (I place myself neither far…

  • Phase 1: complete

    Phase 1: complete

    Several days have passed without updates on my #ZodiacZingers challenge, but I have a good excuse - without experience…

    4 条评论
  • Day 8. Waiting for XB

    Day 8. Waiting for XB

    Read from the beginning One thing that I noticed yesterday, is that on the first load of the card page, it loads quite…

  • Day 7 ?Sprechen vous espa?ol?

    Day 7 ?Sprechen vous espa?ol?

    Read from the beginning Yesterday, I've made some modifications to the site theme. To check if those were effective…

  • Day 6. Not great, not terrible.

    Day 6. Not great, not terrible.

    Previous day and what's the deal. Dealing with the site theme is another "new feature" (for me it is) I'm trying in…

  • Day 5. Eat your own dogfood

    Day 5. Eat your own dogfood

    Previous day and what's the deal. As I mentioned on day 2, I use ddev for the local development.

  • Day 4. Making the first prediction

    Day 4. Making the first prediction

    On Day 3, I've evaluated 2 modules that will be in the heart of Drupal CMS: project browser and ai. Time to write our…

社区洞察

其他会员也浏览了