Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

benmccann
Copy link
Contributor

What is it?

  • Feature / enhancement
  • Bug
  • Docs / tests

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 on window like that only in special circumstances?

Checklist:

  • My code follows the developer guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • Added new tests to cover the fix / functionality

Copy link

vercel bot commented Sep 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
partytown ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 4, 2024 7:13pm

@cornedor
Copy link
Contributor

cornedor commented Sep 4, 2024

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.

@cornedor
Copy link
Contributor

cornedor commented Sep 4, 2024

Aside from that, isn't this a bug? window.gtag = function gtag() {} is completely valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants