Piwik PRO, an alternative to Google Analytics 4

Today I wanted to talk about Piwik Pro, an alternative analytics tool to Google Analytics 4 and that has a free plan that can be interesting to get familiar with it. In the end the topic has become very long, so we are going to divide it into two articles. This first one about implementation and a second one talking more about the interface and analysis possibilities, once a few weeks of data collection have passed.

Why did I try Piwik PRO?

It all came from a tweet from Pablo Urueña, in which he commented that he had done well with Piwik Pro and his documentation to implement it:

So, as I wanted to find an alternative to Google Analytics 4 to compare pros and cons, I started looking around to see how it was going.

Environment in which I have tested Piwik PRO

To implement Piwik PRO, I wanted to do it in an environment that was comfortable for me. That is:

As Pablo said, the Piwik PRO documentation is very complete (in English) and answers almost all the questions you may have as an analyst when implementing this alternative to Google Analytics 4, which helps a lot to take your first steps. The following modules are included with the free plan:

  • Analytics
  • Tag Manager
  • Consent Manager
  • And the administration console, which is separate

How to implement Piwik PRO with Google Tag Manager (GTM)

In this case, we want to use only Analytics and Tag Manager, in addition to the administrator. Since we already use CookieYes, we are not going to use Consent Manager (this is important because I am going to disable all required consents in Piwik PRO). Creating an account is simple, so let’s focus on configuring the first two modules.

Which Piwik PRO label to put in GTM

Here we have two options:

  1. Use the template that Piwik PRO has in Google Tag Manager. This is the simple option and the official documentation tells how to do it, although it has the limitation that you can not use Tag Manager. This is very inconvenient, because it would only measure by default the page views and we would have to manually enter all the events and variables that we want to measure, which would take a lot of work and increase the chances of making mistakes.
  2. Use the complete Piwik PRO tag. We would do this by adding a single Custom HTML tag in GTM,(link to the documentation) keeping its functionalities intact. This is the option we are going to take. Then:

Copy the tracking code from the administration panel -> Instalation -> Google Tag Manager or Install Manually (the tag is the same):

We add the tag to Google Tag Manager for all pages, depending on how you have your cookie consent settings and publish the changes:

As of this moment, your website is already measuring page views. The measurement process would be as follows: Google Tag Manager triggers the full Piwik Pro tag, and this in turn contains the Piwik Pro Tag Manager, using the same triggers. variables and dataLayer to harmonize the measurement between tools:

Now it is time to configure the options in the different modules.

Piwik PRO configuration in the administration module

In the administration module we will find two levels to make configurations:

  • Global Settings
  • Sites & Apps Settings

Global Settings

Here we configure the features that are common to all the sites we are measuring. Within the “Data Collection” section, we can configure the internal search parameters, if we want to exclude URL parameters, filters, campaign variables (already include the UTMs by default) and other features.

In the Privacy section, we must make sure that the option to collect IP information is disabled. Remember that the GDPR considers the IP as personal data, and if we are not going to need it for our analytics, it is better not to collect it:

Sites & apps settings

At this level, we can rewrite some features that we had established as common to make them different for each of the sites, if necessary. It also includes the Data Collection and Privacy sections, with some more functionalities.

In the case of Privacy, we are going to deactivate the consent (thus deactivating the Consent Manager module), since we have it centralized with CookieYes:

Finally, we still need to activate the eCommerce reports, which is what we wanted to measure:

There are more options there to browse, such as account access management, but we won’t go into that in this post.

Piwik PRO Analytics configuration

Let’s take a first look at the settings tab, which has quite a few options, although I will focus on just a few so as not to go into too much detail.

Custom dimensions

Here we create the dimensions we need for the variables we are going to create in the Tag Manager. There are 3 scopes of dimensions:

  • Session dimensions
  • Event dimensions
  • Product dimensions

Yes, there are no user dimensions from this screen. Then we will configure it in the corresponding tag in the Tag Manager.

So, we introduce the variables that we want. Ideally, with a nomenclature equal or similar to the one you have in GTM:

“Ok, Miguel, but you are also putting in variables that are user scope variables as if they were session variables”. True, I wanted to see how they were collected later in Analytics and some of them come in handy to activate audiences in real time. Another day I’ll tell you about PopUp Hero, which allows you to trigger campaigns on the website with the dataLayer using custom triggers.

Channel grouping

As in Universal Analytics and GA4, we can also set up your own channel grouping here. From what I have seen in the documentation, you can set a maximum of 10 channels per grouping and it is not retroactive. This is a limitation, for my taste.

To create the grouping, simply click on “add a custom channel grouping”:

And establish your groups based on your criteria:

Integrations with Google Ads and Google Search Console

You also have integration with Google Ads, easily accessible by logging in with your associated Google/Gmail account and whose data will load in Analytics with a day’s delay:

:

You can also connect your Google Search Console account, although here you will have to take a few more steps in your Google API Console:

This concludes the basic configuration of Analytics. In the future we will be updating functionalities as we discover them.

Piwik PRO Tag Manager configuration

As in GTM, the Piwik PRO Tag Manager also contains variables, triggers and tags, let’s explore how to configure them.

Variables

Accessing the variables menu is quite intuitive, as is adding a variable:

There are many types of variables that will sound familiar to you from GTM, right?

In essence, they work very similarly. In my case, I’m going to start with variables of type dataLayer for the custom dimensions and one of type cookie to popularize the triggers with the consent obtained in CookieYes.

Triggers

With triggers, more of the same:

Here, we will need some of the events we use for eCommerce with the GTM4WP plugin, which we will use to activate our tags. I put here the regEx so you can extract the ones you need:

view_item|view_item_list|select_item|add_to_cart|remove_from_cart|view_cart|begin_checkout|add_payment_info|add_shipping_info|purchase

Important: when you create a trigger, remember to add the restriction of your cookie manager (in my case CookieYes), that’s why we created the variable before:

This ensures that the tags are activated only when the user gives us consent for this type of cookies.

Tags

Finally, the tags:

General etiquette

Here we are going to start with the label “Piwik PRO” (you can rename it but I have left it like this for the moment), which is the general one. Here you can configure interesting things like the userId (which we commented before in Analytics that we could not create it there) and other elements to track:

Custom dimensions, which must first be created in Analytics, as we saw earlier, in order to match the name of the dimension with the value it will take:

Privacy, in which I checked “use secure cookies” and do not require consent (I insist, because I have CookieYes, if you are going to use the Consent Manager here, activate it for the “analytics” type):

And other features that I found interesting such as “detect JavaScript errors”.

Of course, remember to add a trigger. The default is “all pages”, but you have to adapt it to your all pages trigger with CookieYes consent.

Ecommerce labels

Now, we would have to generate the tags for the product-detail-view, add-to-cart, remove-from-cart and order. Each of them has a specific type in Tag Manager:

The good news is that when you add the tag, Piwik PRO gives you the option to map it to your GA4 configuration:

It autofills the corresponding parameters and allows you to modify and add more by scrolling on this screen:

Remember to set its activation trigger and repeat these steps with the rest of the ecommerce tags. With this, you should be ready.

*Important note: If you use the WooCommerce id instead of the sku, keep in mind that WooCommerce generates them as variables of type “integer” and not of type “string”, which is what Piwik PRO expects, so it would generate an error. After seeing it with the Piwik PRO support team, we saw that in order not to incur it, we would have to:

  1. Add a prefix to the product IDs from the GTM4WP plugin to transform it into text:

Thus, we could use the variable “id” instead of the variable “item_id”:

  1. Finally, map the variable “id” instead of “item_id” in the eCommerce tags in the “sku” field:

Ah, don’t forget to publish, otherwise the changes will not be registered:

The main drawback that I have found in Piwik PRO in this first approach is that it does not have a real time module (this is no longer the case, since Piwik PRO added the real-time reporting functionality), so either you do the debugging with the developer tools of your browser, or you wait a few hours for the information to load.

There are still a lot of features to explore. I have seen the “meta setup” in Tag Manager that allows you to make changes in several sites at the same time and it looks very good. We’ll see it in a future post.

So much for today’s post, which was quite long. In a few weeks we will return to Piwik PRO to see how the data looks in its Analytics module. If you’ve made it this far, thank you!

Leave a Comment