Matomo Tag Manager Setup guide
The prerequisite for successful tracking with the Matomo Tag Manager is that all desired action events, view events and attributes are configured in the "tracking_config.json". You can find out how to do this here.
Based on this configuration, PXP sends the corresponding data to Matomo using defined names for triggers and variables.
The configuration must be set up accordingly on Matomo's side. The full PXP support results in the following example structure which shows the full setup to support action events, view-events and, in this example project, two custom dimensions:

It starts with an action event configuration. The event "ISSUE_DOWNLOADED" is used for the following example.
Reduced code from PXP
PXP web client pushes
- an "event" which is configured as "Trigger" and
- data which is configured as "Variable (Data-Layer)"
to Matomo.
The following source code shows a simplified representation of how PXP calls the Matomo Tag Manager API:
Create required "Variables (Data-Layer)" to receive data
The variable names defined by Purple are as follows:
Create the required “Trigger” for PXP to push to.
The trigger name defined by Purple is as follows:
Create a “Tag” that will run when the trigger fires
Create a tag which creates an action event using the variables from Step 1 and assign the trigger from Step 2 to define when this tag executes.
Finally, this is how it works together:

It starts with a view event configuration. The event "STOREFRONT_HOME" is used for the following example.
Reduced code from PXP
PXP web client pushes
- an "event" which is configured as "Trigger" and
- data which is configured as "Variable (Data-Layer)"
to Matomo.
The following source code shows a simplified representation of how PXP calls the Matomo Tag Manager API:
Create required "Variables (Data-Layer)" to receive data
The variable names defined by Purple are as follows:
Create the required “Trigger” for PXP to push to.
The trigger name defined by Purple is as follows:
Create a “Tag” that will run when the trigger fires
Create a tag which creates an action event using the variables from Step 1 and assign the trigger from Step 2 to define when this tag executes.

It starts with an attribute configuration. The attribute "HAS_BOOKMARKS" is used for the following example.
Reduced code from PXP
PXP web client pushes data which is configured as "Variable (Data-Layer)" to Matomo.
The following source code shows a simplified representation of how PXP calls the Matomo Tag Manager API:
Create custom visit dimensions
Add your desired custom visit dimensions.
Create required "Variables (Data-Layer)" to receive data
The variable names defined by Purple are as follows:
Where "n" is an element of the integer positive numbers.
Map custom visit dimensions to Matomo site configuration
Custom visit dimensions are mapped within the corresponding Matomo site configuration.
