Beginner question about data layer in matomo tag manager


I’m trying to understand and implement a simply first data layer for tracking as described at

So I insert the following code before my container:

    var  _mtm =  _mtm || [];
    _mtm.push({'weather': 'sunny'});

I also created a new data layer variable named weather in the container.

But where do I see the values of this variable? Where comes the screenshot in tag manager how to with the text “And then analyze it within Matomo Analytics as shown in the screenshot example below” from? Which step is missing in my case?

Thanks for some help with this!

Best regards,


And I have a next, more detailled question about this topic:

I defined some other variables:

mtm.push({‘userLogin’: true});
_mtm.push({‘userType’: ‘js’});
_mtm.push({‘userId’: ‘123456’});

Now I what to use these values in a html tag script like this:

_paq.push(['setUserId', '{{userId}}']);
_paq.push(['setCustomDimension', 1, '{{userLogin}}']);
_paq.push(['setCustomDimension', 2, '{{userType}}']);

But it seems that this is not working. I don’t see these dimensions in the visitor log.

Do I misunderstand anything or do you see my mistake?

Thanks for some help!

Best regards,


Hi, did you already check the trainings video’s about the tag manager on

Perhaps they help with understanding the datalayer


And another addition:

Now I see the dimensions in the visitor log, but the value I see there is something like

login: window.MatomoTagManager.customHtmlDataStore[1]
user_type: window.MatomoTagManager.customHtmlDataStore[2]

How can I get the “real” value and not the object key?

I found a solution for the problem:

_paq.push(['trackContentImpression', 'Backend', {{PageUrl}}]);

The variables shout not be passed in single quotation marks in the tag-script.