Skip to content

Piwik PRO & CookieTractor

Piwik PRO is a statistics tool and tag manager that has a common background with Matomo but is now marketed as its own product. The tool can be run in the cloud or on its own server, which is suitable for those who want full control over the data collected about the site's visitors.

Piwik PRO mainly consists of two parts:

  • Analytics, comparable to Google Analytics
  • Tag Manager, comparable to Google Tag Manager

Those who are familiar with Google tools will recognize the setup.

Setup CookieTractor with Piwik PRO Tag Manager

CookieTractor integrates with Piwik PRO Tag Manager in an easy way. To control which of your scripts belong to the respective cookie category, the scripts need to be categorized. CookieTractor has built-in support for Piwik PRO and will trigger events based on the visitor's consent settings. To use these inside Piwik PRO, we need to create "Triggers" for any "Tags" dependent on the consent settings.

Go to "Triggers" in Piwik PRO Tag Manager and add new triggers by clicking "Add a trigger". Create the following Triggers:

Name

Trigger Type

Event Name

Consent - Necessary (All Pages)

Data Layer Event

cookies_necessary

Consent - Functional (All Pages)

Data Layer Event

cookies_functional

Consent - Statistical (All Pages)

Data Layer Event

cookies_statistical

Consent - Marketing (All Pages)

Data Layer Event

cookies_marketing

Now, update any Tags that require consent from your users to be triggered by any of these Triggers. This is done by clicking "Edit tag" and then change Trigger under "Execute this tag when any of these triggers are triggered.".

If you need to listen to events when a user revokes a consent, you can create the following Triggers and use them on your Tags:

Name

Trigger Type

Event Name

Consent Revoked - Functional (All Pages)

Data Layer Event

cookies_revoked_functional

Consent Revoked - Statistical (All Pages)

Data Layer Event

cookies_revoked_statistical

Consent Revoked - Marketing (All Pages)

Data Layer Event

cookies_revoked_marketing

Variables to check for consent

In some cases, one might need to check if a visitor has consented to a specific type of cookie using "Conditions" for a Tag or Trigger. To make it easier to access this information, we can add Variables for this under "Variables" in the interface. 

Here are some examples of Variables that might be usefull:

CookieConsent_AllowFunctional

Name: CookieConsent_AllowFunctional
Type: Custom Javascript
JavaScript Function:
function(){
  return cookieTractor.consent.contains('functional');
}

CookieConsent_AllowStatistical

Name: CookieConsent_AllowStatistical
Type: Custom Javascript
JavaScript Function:
function(){
  return cookieTractor.consent.contains('statistical');
}

CookieConsent_AllowMarketing

Name: CookieConsent_AllowMarketing
Type: Custom Javascript
JavaScript Function:
function(){
  return cookieTractor.consent.contains('marketing');
}


Support

If you have any questions about the installation process, please email info@cookietractor.com.