Matomo Documentation
Where to find your Matomo site id?
Select a site
Go to settings
Click to Tracking Code
Terminology
Tags - A snippet of code (usually JavaScript or HTML) which will be added to your site.
Triggers - Defines when a tag should be fired.
Variables - Lets you retrieve data which can be used by tags and triggers.
Tag Manager Testing
The tracking is enabled through code, for classical analytics, and through both code and config on the Tag Manager side.
go to WP backend and change the Matomo Type to Tag Manager.
Change ID to match the desired site (for example ID = 32 is Slav Local)
Creating Matomo Tag Manager Container ID for your site
Go to Tag Manager
Navigate to "Manage Containers"
After you name and create it. The result should look like this
Creating Variables
Once your container is set up, start creating variables.
The following screenshots goes over a few variable examples.
Click on "Variables" in the left navigation menu.
Click "Create New Variable."
Select a tag template called "Alpha Configuration"
Match id with the current Matomo site id
Enter Custom Dimensions if needed by providing id and selecting the name.
Click "Create new variable".
To create variables for Custom Dimensions like Resolution or EpisodeName, select type Data-Layer. Following the format of the below screenshot. Access custom dimensions in the data layer following this convention "customDimension.dimension(dimension id)"
Creating Triggers
Click on "Triggers" in the left navigation menu.
Click "Create New Trigger"
First of all we start with creating Pageview and History triggers to track page views.
A trigger is needed for each event. Below is an example of a trigger event config.
Matomo Tag Manager also includes pre-configured triggers, removing the need for manual code changes. However, users should configure these triggers in Matomo. For instance, the Dom Ready trigger may need a class or ID from the webpage.
Creating Tags
Click on "Tags" in the left navigation menu.
Click "Create New Tag"
Select a tag template called "Alpha Analytics"
Configure tag settings such, triggers, and variables following working examples on the Slav Local site.
Save your tag.
Setup for Page view Tag
Setup for a typical event Tag. Under "Execute this tag when any of these triggers are triggered" notice that the corresponding "Course Create" Trigger is selected.
Creating Versions
After creating all of the needed variables, triggers and tags. These changes need to be published, to do that a new version needs to be created.
Click on "Versions" in the left navigation menu.
Create new version Naming it and selecting the appropriate environments.
When testing changes on a featureslot and Dev environments, make sure all three environments are active and "Live" is selected for Matomo to see changes in your version.