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

feat(gtm): add onBeforeGtmStart #392

Merged
merged 3 commits into from
Feb 18, 2025
Merged

feat(gtm): add onBeforeGtmStart #392

merged 3 commits into from
Feb 18, 2025

Conversation

huang-julien
Copy link
Member

πŸ”— Linked issue

resolve #243

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR improves GTM by adding a new callback to allow users to push anything into the datalayer before we push gtm.start . This way, users will be able to correctly set the consent mode

Copy link

vercel bot commented Feb 16, 2025

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
scripts-docs ❌ Failed (Inspect) Feb 17, 2025 9:51pm
scripts-playground βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Feb 17, 2025 9:51pm

@harlan-zw
Copy link
Collaborator

harlan-zw commented Feb 17, 2025

This is a great escape hatch. Would it be possible to document with an example of when you'd use this πŸ™

I think if all EU users need the consent mode we should have a dedicated docs section for that πŸ€”

@huang-julien huang-julien marked this pull request as draft February 17, 2025 21:11
@huang-julien
Copy link
Member Author

Seems like we DO need to use a gtag() fn in order to configure the consent mode.... This makes 0 sense.

@huang-julien
Copy link
Member Author

I think if all EU users need the consent mode we should have a dedicated docs section for that πŸ€”

Are you talking about a whole page ?

@harlan-zw
Copy link
Collaborator

Nah just like a section in the GTM page, let's go with this for now. Thanks!

@harlan-zw harlan-zw merged commit 5e7d9b4 into main Feb 18, 2025
3 of 4 checks passed
@harlan-zw harlan-zw deleted the feat/gtm_onbeforestart branch February 18, 2025 20:30
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.

Add consent mode for Google Analytics registry script
2 participants