I try to achieve to add the Google Conversion Tag (Google Ads) using Matomo Tag Manager. I am well aware that there is even a custom solution for this https://github.com/matomo-org/tag-manager/issues/159 provided by Matthieu Abry.
But I need to wait for my admins to try this on our on prem installation of matomo.
In the meantime I tried the following:
I added the google tag and set the trigger for it to “DOM ready”.
Now when I try to fire on specific URLs I see the following error message in the console:
Uncaught ReferenceError: gtag is not defined at <anonymous>:2:3 at insertNode (container_8Jipm5bo.js:55) at moveNodes (container_8Jipm5bo.js:56) at Object.fire (container_8Jipm5bo.js:61) at h._doFire (container_8Jipm5bo.js:31) at h.fire (container_8Jipm5bo.js:31) at container_8Jipm5bo.js:29 at Object.setUp (container_8Jipm5bo.js:62) at f.setUp (container_8Jipm5bo.js:28) at n.run (container_8Jipm5bo.js:34)
So I assume that the tag is inserted to late into the page. How can I make sure that the google tag is already loaded before the trigger try to fire it?
I even set the google tag to “HEAD START” and all other tags to “Head end”.