Skip to main content

Matomo Tag Manager Integration

Written by Alexandre Dias Da Silva

Although Google Tag Manager is used by many websites around the world, other Tag management solutions are appearing everywhere.

This is the case with Matomo, which, to complement its traffic analysis service, released Matomo Tag Manager.

No need to worry if you're familiar with GTM, the operation of these two services is relatively similar!

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

To remedy this, here is a piece of code to add to your Axeptio script, which will allow you to transmit all the juicy info đŸȘ coming from Axeptio:

window._axcb = window._axcb || [];
window._mtm = window._mtm || [];
window._axcb.push(function (sdk) {
sdk.on("cookies:complete", function (choices) {
let axeptio_Matomo = [];
for (let vendor in choices) {
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'll then be able to use these events as triggers, just like on Google Tag Manager ✹.

📌 For more information on how Axeptio works with GTM, you'll find the documentation here.

Did this answer your question?