How to add a tracking tag in the Tag Manager

Modified on Wed, 6 Dec, 2023 at 5:31 PM

To place scripts to be executed in the header or body of pages, Matomo provides a set of pre-configured tracking tags and also allows the addition of custom tags.


A brief reminder of what tracking tags are:


Most of the time, when a company launches a website, it contains numerous additional JavaScript codes (referred to as tags), such as:


- Tracking code for audience analysis solution (Matomo or Google Analytics)

- Tracking code for social media (Facebook pixel)

- Tracking code for advertising platform (Criteo)

- Marketing popup management script

- Retargeting script, etc.


Each created tag is placed within the same 'box' called a container. This container holds all the tags present on the site.


The container is then deployed on the website by placing a unique code on each page. This code listens to various events generated by users (clicks, scrolls, form submissions, page changes, etc.).


The role of the container is to activate or deactivate the tags inside it based on pre-established conditions for each tag.


These conditions are called triggers. Triggers are created based on the various user events reported on each page. For example, I could trigger a tag when a user clicks to add an item to the shopping cart on my e-commerce site, or when a user is on a thank-you page after making a purchase. A tag is always associated with a trigger.


Adding a custom tag

You can view the process here 



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article