Open tcetin opened 9 months ago
We are trying to load and trigger google tag manager events by using partytown. It doesn't trigger the gtm events. It is implemented in NextJS.
Here is the configuration in _document.tsx
_document.tsx
<Partytown debug logCalls logGetters logSetters logImageRequests logMainAccess logSendBeaconRequests logStackTraces logScriptExecution forward={["dataLayer.push"} />
Here is the google tagmanager script:
<script 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','tag-manager-id');` }} />
I tried to find the issue by debugging. I am just able to see this log:
partytown-ww-sw.js:1611 Fetch failed loading: POST "https://www.google-analytics.com/g/collect?v=2..."
We reverted it on the prod. We test it locally.
Chrome
No response
Thanks for opening this issue. I will try to spin up a NextJS app to reproduce the issue
It seems the same issue happens on the https://partytown.builder.io/google-tag-manager .
Describe the bug
We are trying to load and trigger google tag manager events by using partytown. It doesn't trigger the gtm events. It is implemented in NextJS.
Here is the configuration in
_document.tsx
Here is the google tagmanager script:
I tried to find the issue by debugging. I am just able to see this log:
partytown-ww-sw.js:1611 Fetch failed loading: POST "https://www.google-analytics.com/g/collect?v=2..."
Reproduction
We reverted it on the prod. We test it locally.
Steps to reproduce
Browser Info
Chrome
Additional Information
No response