@housseindjirdeh I updated my Nextjs to 1.12.6 and tried using worker strategy but I'm facing an issue, I'm using Partytown but Partyproxy is making a lot of requests on each page I visit. I'm using Next so I don't have any configs for PartyTown, I just put my script's strategy as a worker #58328
@housseindjirdeh I updated my Nextjs to 1.12.6 and tried using worker strategy but I'm facing an issue, I'm using Partytown but Partyproxy is making a lot of requests on each page I visit. I'm using Next so I don't have any configs for PartyTown, I just put my script's strategy as a worker
I am facing the same issue here, I have a custom nextjs server and Partytown is sending multiple requests to my inline GTM code
here is my _document.js file
<Partytown debug={true} forward={['dataLayer.push']} />
<script defer
type="text/partytown"
dangerouslySetInnerHTML={{__html: (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','${GTM_ID}')}}/>
I have also added nextScriptWorkers true in my next config
Originally posted by @RigottiG in https://github.com/vercel/next.js/issues/36123#issuecomment-1117236344
I am facing the same issue here, I have a custom nextjs server and Partytown is sending multiple requests to my inline GTM code
here is my _document.js file <Partytown debug={true} forward={['dataLayer.push']} /> <script defer type="text/partytown" dangerouslySetInnerHTML={{__html:
(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','${GTM_ID}')
}}/>I have also added nextScriptWorkers true in my next config