-
Notifications
You must be signed in to change notification settings - Fork 437
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
docs: revert recent docs changes making gtag
a window
global
#623
base: main
Are you sure you want to change the base?
Conversation
This reverts commit 0258d26.
…wikDev#578)" This reverts commit 710ea8d.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Do you perhaps create the gtag function from another scripts already running in partytown? Maybe that clashes. I think it would be better to keep it in the docs, but point out that it is not always necessary. |
Aside from that, isn't this a bug? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you let me know if your implementation with the old code currently works correctly? If so, can we update the docs with your code instead of removing it?
Thanks
Nope
Did you have some typo here? I don't understand what you're saying.
When I was referring to the old code I mean the previous state of the tutorial. E.g. here you can see what the page looked like 10 months ago: https://github.com/QwikDev/partytown/blob/759fc6b9be77c50094f38ce2c783116578e7bec5/docs/sveltekit.md
I'm not sure what you mean. There was new code added that broke it. To go back to the old version means removing the changes that broke it. I don't quite know what else to do |
No, this wasn't a typo. This way, you have to make the least amount of changes for the function to work. I assume this worked for me because without
I think it would be great to keep part of it in the docs as reference. The old situation did not work for me, and it took quite a lot of time to figure out what was wrong. I suggest keeping it in the docs with something like: "If a function definition in global scope does not work, you could try to explicitly assign it to window" |
What were you referring to when you said "Aside from that, isn't this a bug?" It would be nice to understand when exactly |
That small change should not change how that function is working. If it breaks on your project, something seems to be going on.
I'll try to replicate the issue I had, but I have to make some time for this. If I recall correctly, it might have something to do with the |
What is it?
Description
reverts #570 by @a4vg and #578 by @cornedor
Use cases and why
When I upgraded to the latest partytown I updated my project with the latest changes from the docs as well. When I visited my sight after these changes no hits appeared in Google Analytics until I reverted these changes. The old code had been present and working for a very long time. I don't think the new code works in all circumstances. I have a very basic project with no additional setup besides what is in the docs. Maybe
gtag
should be set onwindow
like that only in special circumstances?Checklist: