BuilderIO / partytown

Relocate resource intensive third-party scripts off of the main thread and into a web worker. 🎉
https://partytown.builder.io
MIT License
12.88k stars 427 forks source link

[🐞] Code script (gtag.js) is injected when we are using GTM #456

Open AbrahamIQConsulting opened 11 months ago

AbrahamIQConsulting commented 11 months ago

Describe the bug

Implementing party town with GTM, this kind of script is injected in the browser:

Reproduction

private integration environment

Steps to reproduce

put type="text/partytown" with the script of GTM

After if we inspect the code we can see other script injected:

Testing only GTM without text/partytown this not happens in the site.

Browser Info

Chrome

Additional Information

No response

thejackshelton commented 10 months ago

Hey I created an empty astro app to try and replicate this behavior, the only script I saw other than an inline script was this:

image

Is this what you're talking about? I noticed the slugs are different.

AbrahamIQConsulting commented 10 months ago

Not, is exactly the GTag script that i shared. Other thing that i don't know if this is the reason. In GTM we have events and we add the GA4 by tag. Other thing that i don't mention before, is if i use the Google Tag Assistance plugin for chrome, this show an issue of implementation ( when this script injected in the header.)