Use anonymous tracking in GTM without Piwik PRO Tag Manager and Consent Manager

Hi Kuba,

I am in the same case than Joao : we use GTM and CookieBot. We do not want tu use neither PPTM nor Consent Manager. Is there a way to configure Piwik Pro analytics, in GTM, to collect data without cookies when the user opt out to be CNIL compliant ?

In the case of an opt-ou user I puted in place this configuration tag :

var _paq = window._paq = window._paq || [];
    _paq.push(["disableCookies"]);
    _paq.push(["deleteCookies"]);
    _paq.push(["setUserIsAnonymous", true]);
    
    (function() {
      var u="https://ABCD.pro/";
      _paq.push(['setTrackerUrl', u+'ppms.php']);
      _paq.push(['setSiteId', '123']);
    
      var secondaryTrackerUrl = 'https://ABCD.pro/ppms.php';
      var secondaryWebsiteId = '456';
      // Also send all of the tracking data to this other server, in website ID 456
      _paq.push(['addTracker', secondaryTrackerUrl, secondaryWebsiteId]);

      var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
      g.type='text/javascript'; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
    })();
  
    _paq.push(['setCustomDimensionValue', 4, {{A}}]);
    _paq.push(['setCustomDimensionValue', 5, {{B}}]);
    _paq.push(['setCustomDimensionValue', 6, {{C}}]);
    _paq.push(['trackPageView']);
    _paq.push(['enableLinkTracking']);

But when I opt out I still have these cookies :

How can I configure my tag to track user anonymously, be CNIL compliant and keep using GTM and CookieBot ?

1 Like

Hello, I did placed a PPTM HTML Tag inside GTM to achieve the setup but what Lisa proposes would be ideal also to reduce JS load and therefore reduce page load timing impact.

Thanks

Could you test in in incognito mode? You have there many cookies that are created after visiting product’s UI. There is a domain match, so you can see them in the console.

1 Like