Matomo Tag Manager Integration

Loïc
Loïc
  • Updated

While Google Tag Manager is used by many sites around the world, other tag management solutions are appearing everywhere.

This is the case of Matomo, which, to complete its traffic analysis service, has released Matomo Tag Manager.

Don't worry if you are used to GTM, the functioning of these two services is quite similar!

However, Axeptio sends the consent information automatically to GTM, which is not the case for Matomo Tag Manager.

To fix this, here is a piece of code to add in your Axeptio script, which will allow to send all the crispy info 🍪 coming from Axeptio :

window._axcb = window._axcb || [];
window._mtm = window._mtm || [];
window._axcb.push(function (sdk) {
  sdk.on("cookies:complete", function (choices) {
    letaxeptio_Matomo = [];
    for (letvendorinchoices) {
      if (vendor != "$$completed" && choices[vendor] == true) {
        _mtm.push({ event:`axeptio_activate_${vendor}` });
        axeptio_Matomo.push(vendor);
    }
  }
    _mtm.push({"axeptio_Matomo":axeptio_Matomo});
});
});

This will send the "axeptio_activate_CookieName" events to Matomo, and you can then use these events as triggers, just like on Google Tag Manager.

Was this article helpful?

3 out of 9 found this helpful