Manage Tags in Matomo Tag Manager
A tag is a snippet of code which can be executed on your site. Most of the time a tag may be used to either send data to a third-party (for example tracking data) or to embed content from a third-party into your website (for example social widgets or surveys). You can add as many tags as you like and a tag will be executed as soon as the condition of a connected trigger is met.
In order to create a new tag:
Select the tag you would like to include within the container, for example “Matomo Analytics”, in order to embed the Matomo tracking code into your website through the TMS:
Configuring a tag
The tag configuration consists of three main parts:
1. A section where you configure the tag itself and what it should do or how the tag should behave, for example you may configure a Matomo Tracking URL or your Google Analytics Property ID. The available form fields in this section differ from tag to tag.
2. A section where you configure when this tag should be executed (or blocked). This is done by assigning a so called trigger. Only when such a trigger is being triggered, the tag will be executed.
3. Advanced settings that let you configure, for example how often the tag should be executed, limit the date range when the tag should be executed, and more.
1 – Configuring a tag
As each tag represent a different solution: Matomo Analytics, Google Analytics, Facebook conversion pixel, remarketing tag etc. each configuration panel is different according to the tag you selected.
Some can be very complete and composed of multiple fields, that’s the case for Matomo Analytics whereas others such as the custom HTML tag will need only one field to fill in:
2 – Configure when a tag should be executed
When you copy/paste the Matomo Analytics JavaScript default tracking code, it is sending the data to the Matomo server on each pageview. This behaviour can be problematic in some situations, for example, certain pages should be tracked in conditions where consent is required from the user.
You can configure when a tag should be executed through Triggers. If you are not familiar with a tag manager or triggers yet, we recommend you read the Triggers guide to understand this concept.
3 – Advanced settings
Some users may need a complex configuration like setting the number of times a tag should be fired, the order in which tags should be triggered, and even which specific start date a tag should be triggered and ended.
One mere example could be a remarketing campaign where cookies will be set until a specific end date. This is exactly what the advanced settings are designed for:
In the screenshot example above, by defining an end date, it will automatically stop the tag triggering without the need for you to go back into the backend to remove it.
Congratulations, you have just configured your first tag! However, the tag will not yet be loaded on your website as some more important steps are missing: