-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[🐞] Web Worker Instance Errors and postMessage Origin Mismatches with GTM in Partytown Proxy Setup #637
Comments
I also tested the same approach as you, and after conducting tests on the GA4 metrics, we observed a significant drop in data accuracy. During our tests, we evaluated organic data from social sources like Facebook, X (formerly Twitter), and Line. Specifically, we noticed that organic data from Facebook was underreported compared to actual activity. For example, in a test with 10 visits, only 6 were recorded. This discrepancy suggests that the effectiveness of Partytown on production data is not yet optimal. I have experience in JavaScript development, but my understanding of GTM and GA4 is limited. If you have any insights or resources to share, I would be happy to contribute to improving Partytown's performance in a production environment. |
Thanks for sharing your experience and testing observations @ducsatthu, Right now, my main priority is getting GTM tags firing correctly and resolving the current issues with the Partytown setup, like the instance errors and the postMessage origin mismatches. Once those are sorted, I’ll definitely take a closer look at how this setup impacts GA4 data accuracy. Your point about discrepancies in organic data from platforms like Facebook is super helpful, and it’s definitely something I’ll keep in mind when I get to that stage. But for now, the focus is on ironing out these technical issues to ensure GTM works as expected within Partytown. Thanks again for your feedback, it is always good to hear from someone testing in a similar environment/setup! Let me know if you’ve found anything else that might help resolve the proxy issues. |
FYI: I will be unavailable for the next 4 weeks |
Hi, Following up on my previous message, I am available to give you more information that will help with debugging my issue. |
Hi team, Following up on the issues I've raised with integrating GTM into Partytown, particularly the "Error finding instance" and postMessage origin mismatch errors. I'm available now to provide any additional logs, configurations, or testing details you might need to help debug this further. Resolving these issues is crucial for us to move forward with our implementation. Additionally, if there’s any update or workaround that has been explored since my last message, I’d appreciate it if you could share it. Looking forward to your guidance! Best regards, |
Hi @anthonythorne Can you create a basic example of this problem? |
Describe the bug
We’re implementing Partytown on our website to offload third-party scripts, specifically Google Tag Manager (GTM), to a web worker. Our primary goals are to reduce main-thread load, improve page performance, and ensure a smooth and secure way to proxy external resources.
Currently this feature requires a URL parameter so that the site remains unaffected.
URL: https://fujifilm-x.com/global/?googletagmanager=partytown
Current Setup
resource_url
and verifies that the request originates from an allowedrequest_origin
.resolveUrl
function in Partytown’s configuration to intercept URLs for specified external domains.resource_url
andrequest_origin
parameters.Encountered Issues
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.googletagmanager.com') does not match the recipient window's origin
.It’s unclear whether this is directly related to Partytown or is a side effect of the web worker environment.
Actions Taken
Assistance Needed
If possible can I get advise on the following, please?
If you require further information, such as code examples or additional logs, please let us know.
Reproduction
https://fujifilm-x.com/global/?googletagmanager=partytown
Steps to reproduce
Unable to verify or validate if GTM is correctly running.
Browser Info
Chrome
Additional Information
No response
The text was updated successfully, but these errors were encountered: