GTM Implementation Question

(Dan Katz) #1

We have a quick question to complete the configuration of our cloud account we purchased -

We are using Google Tag manager to send the code for various actions to Matomo. We have the overall tracking script execute. Then we want to push events to Matomo. We have HTML tags firing when needed as seen below.

for example

The question is?

Do we also have to add a closing trackPageView to every event in order to get this actually pushed to Matomo? We did not think so because we though this would then would record another hit on the page. Or, is the set of push items we have in the HTML tag sufficient since the trackPageView has already occured on the page?

(Ronan Chardonneau) #2

Hi Dan,

For some reasons, the tracking code you would like to show us does not display on my browser, so I will try to answer without seeing it.
So GTM is set on all pages of your website.
Then within GTM you defined as a tag called Matomo which fire on all pages.
As a result you already have the track page view running on all pages.
Then you can defined on any pages which is tracked with Matomo the event tracking from Matomo.
As far as the general Matomo tracking code is present on the page you can fire the event tracking code, no issue.
The best thing if you want to test is to use the preview mode.
If you still have a question about it, just answer to this message and I will post a video about it.


(Dan Katz) #3

This is indeed how I have the tags set to fire.

_paq_push(['setCustomDimension',2,'{{Path Cookie}}']);
_paq.push(['trackEvent', 'Browsing Paths', '{{Path Cookie}}', '{{Click URL}}']);

Will the above work? Or, do I need to integrate the dimension into the trackevent push?

Can I do the same with Goals pushes or do need a pagetrack or trackevent push to be actually sent to the server?

(Dan Katz) #4

Interesting - My code gets wiped out each time I submit. I have a custom dimensions push followed by a trackevent push.

(Lukas Winkler) #5


You can use a codeblock here on the forum using the </> button or wrapping it in three backticks (```)