Enable GTM/cookie tracking on p3m.dev and packagemanager.posit.co - #182
Open
jstruzik wants to merge 1 commit into
Open
Enable GTM/cookie tracking on p3m.dev and packagemanager.posit.co#182jstruzik wants to merge 1 commit into
jstruzik wants to merge 1 commit into
Conversation
The GTM snippet and cookie preference center icon only activate on docs.posit.co and netlify.app. Posit Package Manager serves this theme's docs under p3m.dev/__docs__ and packagemanager.posit.co/__docs__, so no Google Analytics data is collected there. Add both hosts to the allowlist for the GTM script and the cookie preference center icon. Note: enabling GTM on these hosts requires WebOps to opt them into tracking (per README cookie-consent guidance) — coordinate before release. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
✅ Deploy Preview for product-doc-theme ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
packagemanager.posit.coandp3m.devto the hostname allowlist in_extensions/posit-docs/assets/_analytics.html, for both:GTM-KHBDBW7) script injection, andThis matches the existing
docs.posit.co/netlify.appbehavior. (includes("p3m.dev")also covers*.p3m.devstaging hosts.)Why
Posit Package Manager vendors this theme and serves the docs under
p3m.dev/__docs__andpackagemanager.posit.co/__docs__. Because the analytics snippet only activates ondocs.posit.co/netlify.app, no GA4 data is collected for the PPM-hosted docs, even though the rest of those sites track fine. Reported in rstudio/package-manager#16379.The README notes that cookie consent is managed by GTM and that WebOps must opt a site into tracking before the theme is bumped to enable it. This PR is the code half; it should not be released/merged until
p3m.devandpackagemanager.posit.coare confirmed opted into GTM tracking. Flagging so the compliance step isn't skipped.Follow-ups for maintainers
changelog.mdentry + version bump on the next release (left to your release process).Testing
After a site is opted in and the theme is deployed, load
https://p3m.dev/__docs__/and confirm theGTM-KHBDBW7container loads (GA4 real-time) and the cookie preference icon appears in the footer; verifydocs.posit.cobehavior is unchanged.