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.97k stars 427 forks source link

[šŸž] GTM doesnt work #608

Closed musashiM82 closed 1 month ago

musashiM82 commented 1 month ago

Describe the bug

Hi google tag mananger doesn't work from yesterday. below you can find code that I used from two years and tag injection doesnt work from yesterday. I dont see any tag (pixel, analytics or custom) in the DOM.

what is the problem?

thanks

Reproduction

Steps to reproduce

<script type="text/javascript">
        partytown = {
            forward: ["dataLayer.push","fbq"],
            resolveUrl: function (url, location, type) {
                var proxyMap = {"static.ads-twitter.com":{"hostname":"*******","pathname":"/twitter"},"connect.facebook.net":{"hostname":"*********","pathname":"/facebook"}}
                if (type === 'script' && proxyMap[url.hostname]) {
                    url.pathname = proxyMap[url.hostname].pathname + url.pathname
                    url.hostname = proxyMap[url.hostname].hostname;
                }
                return url;
            },
        };
    </script>
<script src="/30/~partytown/partytown.js?v_=5"></script>
    <script type="text/partytown">(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
              new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
              j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
              'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
              })(window,document,'script','dataLayer','********');
    </script>

Browser Info

chrome firefox

Additional Information

using @builder.io/partytown 0.7.2

No response

musashiM82 commented 1 month ago

solved upgrading partytown

dathacky commented 4 days ago

+1 version 0.10.2

dathacky commented 4 days ago

What version are you using? @musashiM82