3rd party integrations
...
Tracking Services
Matomo / Matomo Tag Manager

Matomo Tag Manager Setup guide

15min

Description

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:

Document image


Tags

To connect PXP with Matomo Tag Manager, both tags are required:

Document image


Trigger

To connect PXP with Matomo Tag Manager, both triggers are required:

Document image


Variables

To connect PXP with Matomo Tag Manager these variables are required:

Document image


Events and Attributes

Action events

PXP

It starts with an action event configuration. The event "ISSUE_DOWNLOADED" is used for the following example.

tracking_config.json


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:

PXP code for API call


Configuration in Matomo Tag Manager

1

Create required "Variables (Data-Layer)" to receive data

The variable names defined by Purple are as follows:

purple.action_event_category purple.action_event_action purple.action_event_name purple.action_event_value
2

Create the required “Trigger” for PXP to push to.

The trigger name defined by Purple is as follows:

purple.action_event
3

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.

Summary

Finally, this is how it works together:

Document image


View events

PXP

It starts with a view event configuration. The event "STOREFRONT_HOME" is used for the following example.

tracking_config.json


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:

PXP code for API call


Configuration in Matomo Tag Manager

1

Create required "Variables (Data-Layer)" to receive data

The variable names defined by Purple are as follows:

purple.view_event_title
2

Create the required “Trigger” for PXP to push to.

The trigger name defined by Purple is as follows:

purple.view_event

Trigger for View-Event

Document image

3

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.

Tag (Name)

Document image


Tag (Create event)

Document image


Tag (Use trigger)

Document image


Summary

Document image


Attributes

PXP

It starts with an attribute configuration. The attribute "HAS_BOOKMARKS" is used for the following example.

tracking_config.json


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:

PXP code for API call


Configuration in Matomo Tag Manager

1

Create custom visit dimensions

Add your desired custom visit dimensions.

Custom dimensions

Document image

2

Create required "Variables (Data-Layer)" to receive data

The variable names defined by Purple are as follows:

purple.custom_dimension_1 ... purple.custom_dimension_n

Where "n" is an element of the integer positive numbers.

Custom dimension 1

Document image


Custom dimension 2

Document image

3

Map custom visit dimensions to Matomo site configuration

Custom visit dimensions are mapped within the corresponding Matomo site configuration.

Matomo site configuration

Document image


Summary

Document image