GTM HTML Tag and _paq.push


(Dan Katz) #1

BTW To others - outside of this system I was told that yes we can use GTM variables in HTML tags for using GTM to push events and other uses of the JS statements into Matomo.

Now my question is the format.

_paq.push([‘trackEvent’, ‘Forgot Password - Request’, ‘{{Click Text}}’, ‘{{Form URL}}’]);

I have the above statement.

  1. Should I have a single quote around the GTM variable? Or, should the quotes not be there?

  2. Do I need anything else in the HTML such as wrapping the statement in or a function statement or anything else?

  3. I assume I need to be sure to fire that after the initial Matomo script. Anything else I should be aware of using GTM and setting this tag?