We are using Google Tag Manager so we can use both Google Analytics and Matomo without a developer to place the variety of customized push events within the code on each page or link.
We have this working with Google Analytics to fire off the events, custom events, custom dimensions and the variety of other GA push code. Easy as this is all built it.
Now comes the lift to get this running in Matomo.
I see and am familiar with the code to push an event or other aspect into Matomo with the following when editing the JS code. However, I do have a few questions as this relates to GTM to make this easier.
- Can I simply create a GTM HTML tag with the above script and place in the dataLayer variables or JS variable names for Event Category, etc. Will GTM then insert these into the Matomo script?
- Can this HTML tag then have this simple line since the Matomo JS tag has already fired? Or, does this also need an additional trackPage line to record this to the Matomo server?