Open brandonfredericksen opened 3 weeks ago
Having the same issue.
Indeed, when gtm.js tries to create this iframe, Partytown seems to be proxying this behavior and doing something else (perhaps requesting the iframe src) instead. Since, this src matches loadScriptsOnMainThread
, I would expect Partytown to allow gtm.js to create the iframe in the dom normally, but it does not.
Even if Google were to return cors headers for sw_iframe.html
or if this is mitigated with a reverse proxy, I anticipate another issue. Google's code within this iframe seems to be attempting to register a service worker itself, and I'm not sure if Partytown will allow this type of service worker inception.
It's also not clear if sw_iframe.html
is even necessary. Tags still seem to load without it.
@jrood
The page_view
data collected from Google Analytics, originating from Facebook, has decreased by half.
Describe the bug
I'm getting the following CORS error when using Partytown and Google Tag Manager.
Access to XMLHttpRequest at 'https://www.googletagmanager.com/static/service_worker/4al0/sw_iframe.html?origin=https%3A%2F%2Fwww.url.com' from origin 'https://www.url.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Error happens in production as well.
Current implementation:
I'm using Remix. I've tried adding the url to the
loadScriptsOnMainThread
without success:Reproduction
private
Steps to reproduce
Use Partytown with Google Tag Manager
Browser Info
Chrome
Additional Information
No response