How to use Matomo Analytics tag


#1

Hi,
I’m trying the free trial version of Matomo and can not get the Matomo Analytics Tag in Tag Manager to track events in a single page Angular2 app.

I am assuming that the pushing of events to the dataLayer is no problem, since I can find several event objects in window.MatomoTagManager.dataLayer.events such as:

{ 
     event: "dataLayerEvent"
     action: "unlockApp"
     category: "sessions"
     label: "App unlock",
     value: null
}

In Tag Manager I created several custom dataLayer variables called ‘event’, ‘action’, ‘category’, ‘value’ and ‘label’.

I also created a trigger with name ‘dataLayerEventTrigger’ and event name ‘dataLayerEvent’.

Then I created a Matomo Analytics Tag with the following settings:

Tracking type: Event
Event category: {{ category }}
Event action: {{ action }}
Event name: {{ label }}
Event value: {{ value }}
Execute this tag when any of these triggers are triggered: dataLayerEventTrigger

Maybe I do not grasp the concepts completely yet, but I would expect to get results now in my Matomo dashboard. I tried it by making a custom report with dimensions ‘Event category’ and ‘Event action’ but it does not show any data.

The container should work, because the Javascript tracking does result in page views in my Matomo dashboard. The Tag Manager tracking does not seem to work though. Any ideas of what I am missing here?

Thanks already!


#2

By the sounds it looks all correct. Is there any chance you could export the container and paste it here? Or get in touch with our support by email (support at matomo . cloud)

Also in case you are familiar with browser debugging tools: Do you maybe see any errors or tracking requests in the browser debugging tools?


#3

Thanks for your fast reply. I do not see any errors in the consoles of several browsers. I also do not find the Tag Manager debug console when I preview the container…

This is my container (replaced the url with fake):

{  
   "idcontainer":"fLyk0WXk",
   "idsite":1,
   "context":"web",
   "name":"Staging",
   "description":"Staging environment",
   "created_date":"2019-02-27 14:34:39",
   "updated_date":"2019-02-27 14:34:39",
   "created_date_pretty":"Feb 27, 2019 15:34:39",
   "updated_date_pretty":"Feb 27, 2019 15:34:39",
   "revision":0,
   "version":{  
      "name":"",
      "description":"",
      "revision":0,
      "created_date":"2019-02-27 14:34:39",
      "created_date_pretty":"Feb 27, 2019 15:34:39",
      "updated_date":"2019-02-27 14:34:39",
      "updated_date_pretty":"Feb 27, 2019 15:34:39"
   },
   "tags":[  
      {  
         "idtag":3,
         "type":"Matomo",
         "name":"Matomo Analytics",
         "parameters":{  
            "matomoConfig":"{{Matomo Configuration}}",
            "trackingType":"event",
            "idGoal":"",
            "documentTitle":"",
            "customUrl":"",
            "eventCategory":"{{category}}",
            "eventAction":"{{action}}",
            "eventName":"{{label}}",
            "eventValue":"{{value}}"
         },
         "fire_trigger_ids":[  
            4
         ],
         "block_trigger_ids":[  

         ],
         "fire_limit":"unlimited",
         "priority":999,
         "fire_delay":0,
         "start_date":null,
         "end_date":null,
         "created_date":"2019-02-28 09:49:05",
         "updated_date":"2019-02-28 09:49:05",
         "created_date_pretty":"Feb 28, 2019 10:49:05",
         "updated_date_pretty":"Feb 28, 2019 10:49:05"
      }
   ],
   "triggers":[  
      {  
         "idtrigger":4,
         "type":"CustomEvent",
         "name":"Custom Data Layer Event (staging)",
         "parameters":{  
            "eventName":"dataLayerEvent"
         },
         "conditions":[  

         ],
         "created_date":"2019-02-28 09:47:47",
         "updated_date":"2019-02-28 10:13:33",
         "created_date_pretty":"Feb 28, 2019 10:47:47",
         "updated_date_pretty":"Feb 28, 2019 11:13:33"
      }
   ],
   "variables":[  
      {  
         "idvariable":1,
         "type":"MatomoConfiguration",
         "name":"Matomo Configuration",
         "parameters":{  
            "matomoUrl":"https://ourwebsitename.matomo.cloud/",
            "idSite":"1",
            "enableLinkTracking":true,
            "enableCrossDomainLinking":false,
            "enableDoNotTrack":false,
            "enableJSErrorTracking":false,
            "enableHeartBeatTimer":false,
            "trackAllContentImpressions":false,
            "trackVisibleContentImpressions":false,
            "disableCookies":false,
            "setSecureCookie":false,
            "cookieDomain":"",
            "cookiePath":"",
            "alwaysUseSendBeacon":false,
            "userId":"",
            "customDimensions":[  

            ],
            "bundleTracker":true
         },
         "lookup_table":[  

         ],
         "default_value":"",
         "created_date":"2019-02-27 15:05:38",
         "updated_date":"2019-02-27 15:05:38",
         "created_date_pretty":"Feb 27, 2019 16:05:38",
         "updated_date_pretty":"Feb 27, 2019 16:05:38"
      },
      {  
         "idvariable":4,
         "type":"DataLayer",
         "name":"value",
         "parameters":{  
            "dataLayerName":"value"
         },
         "lookup_table":[  

         ],
         "default_value":"",
         "created_date":"2019-02-28 09:34:45",
         "updated_date":"2019-02-28 09:35:04",
         "created_date_pretty":"Feb 28, 2019 10:34:45",
         "updated_date_pretty":"Feb 28, 2019 10:35:04"
      },
      {  
         "idvariable":5,
         "type":"DataLayer",
         "name":"event",
         "parameters":{  
            "dataLayerName":"event"
         },
         "lookup_table":[  

         ],
         "default_value":"",
         "created_date":"2019-02-28 09:35:17",
         "updated_date":"2019-02-28 09:35:17",
         "created_date_pretty":"Feb 28, 2019 10:35:17",
         "updated_date_pretty":"Feb 28, 2019 10:35:17"
      },
      {  
         "idvariable":6,
         "type":"DataLayer",
         "name":"action",
         "parameters":{  
            "dataLayerName":"action"
         },
         "lookup_table":[  

         ],
         "default_value":"",
         "created_date":"2019-02-28 09:35:30",
         "updated_date":"2019-02-28 09:35:30",
         "created_date_pretty":"Feb 28, 2019 10:35:30",
         "updated_date_pretty":"Feb 28, 2019 10:35:30"
      },
      {  
         "idvariable":7,
         "type":"DataLayer",
         "name":"category",
         "parameters":{  
            "dataLayerName":"category"
         },
         "lookup_table":[  

         ],
         "default_value":"",
         "created_date":"2019-02-28 09:35:48",
         "updated_date":"2019-02-28 09:35:48",
         "created_date_pretty":"Feb 28, 2019 10:35:48",
         "updated_date_pretty":"Feb 28, 2019 10:35:48"
      },
      {  
         "idvariable":8,
         "type":"DataLayer",
         "name":"label",
         "parameters":{  
            "dataLayerName":"label"
         },
         "lookup_table":[  

         ],
         "default_value":"",
         "created_date":"2019-02-28 09:36:11",
         "updated_date":"2019-02-28 09:36:11",
         "created_date_pretty":"Feb 28, 2019 10:36:11",
         "updated_date_pretty":"Feb 28, 2019 10:36:11"
      }
   ]
}