Google Tag Manager script integration #36
sergiocastro95
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
Following the way to integrate the tinybird script that sends the events is this:
This works if you hardcoded the snippet directly in your html
<head>
tag, but it doesn't work if you try to insert throught Google Tag Manager.GTM removes all
data-attributes
(anddefer
too) so the script could not take the tracker token and all the requests fails:The solution is to change the original script for this one (you could minify it before use in production):
It creates your script tag with all data needed once page is load, so GTM can't remove any
data-attributes
.As a result, script loads correctly and the events are sent 🎉
It also works if you copy&paste directly inside
<head>
tag. So this could be the default way to insert the script in any web page.Beta Was this translation helpful? Give feedback.
All reactions