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 tracking configuration 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 matomo structure in detail tags to connect pxp with matomo tag manager, both tags are required trigger to connect pxp with matomo tag manager, both triggers are required variables to connect pxp with matomo tag manager these variables are required 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 "issue downloaded" { "templates" { "category" "app", "action" "issue downloaded", "name" "{{issue name}}", "value" "1" } } 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 // code for action events const eventdata = { 'event' 'purple action event', // trigger 'purple action event category' , // variable 'purple action event action' , // variable 'purple action event name' , // variable 'purple action event value' // variable }; window mtm push(eventdata); configuration in matomo tag manager 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 purple action event category purple action event action purple action event name purple action event value matomo example variable to receive category variable to receive action variable to receive name variable to receive value create the required “trigger” for pxp to push to the trigger name defined by purple is as follows purple action event purple action event matomo example trigger for action event 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 matomo example tag (name) tag (create event) tag (use trigger) summary finally, this is how it works together view events pxp it starts with a view event configuration the event " storefront home " is used for the following example tracking config json "storefront home" { "templates" { "title" "any page title" } } 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 // code for view events const eventdata = { 'event' 'purple view event', // trigger 'purple view event title' // variable }; window mtm push(eventdata); configuration in matomo tag manager create required "variables (data layer)" to receive data the variable names defined by purple are as follows purple view event title purple view event title matomo example variable to receive view title create the required “trigger” for pxp to push to the trigger name defined by purple is as follows purple view event purple view event matomo example trigger for view event 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 matomo example tag (name) tag (create event) tag (use trigger) summary attributes pxp it starts with an attribute configuration the attribute " has bookmarks " is used for the following example tracking config json "has bookmarks" { "templates" { "id" "1" } } 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 // code for custom dimensions const index = // value is configured in tracking config json const datalayername = `purple custom dimension ${index}`; const customdimensiondata = { \[`${datalayername}`] // variable }; window mtm push(customdimensiondata); configuration in matomo tag manager create custom visit dimensions add your desired custom visit dimensions matomo custom dimensions 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 purple custom dimension 1 purple custom dimension n where "n" is an element of the integer positive numbers matomo custom dimension 1 custom dimension 2 map custom visit dimensions to matomo site configuration custom visit dimensions are mapped within the corresponding matomo site configuration matomo matomo site configuration summary