analytics: send docs pageviews to the canonical litellm.ai GA4 property - #1441
Merged
Conversation
Adds G-G3LG9H6J6B alongside the existing docs property G-K7K215ZVNC. docs.litellm.ai is a subdomain of litellm.ai and the marketing site's CTAs point at the docs quickstart, but the two sites reported into separate GA4 properties, so that journey was unattributable. Both sites now share a measurement ID; gtag's default cookie domain is the registrable domain, so sessions stitch across the subdomains without cross-domain configuration. G-K7K215ZVNC stays first in the array and keeps collecting, so the docs property's history is unaffected.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
G-G3LG9H6J6Bas a second GA4 destination alongside the existing docs propertyG-K7K215ZVNC.Why
docs.litellm.aiis a subdomain oflitellm.ai, and most CTAs on the marketing site point at the docs quickstart — but the two sites reported into separate GA4 properties, so that journey (www.litellm.ai→ docs quickstart) was unattributable. A visitor looked like a bounce on the marketing site and an unattributed direct arrival on docs.With the same measurement ID on both, sessions stitch across the subdomains. No cross-domain configuration is needed: gtag's default cookie domain is the registrable domain (
litellm.ai), so the_gacookie is already shared.Behaviour
@docusaurus/plugin-google-gtagnormalisestrackingIDto an array and, per its 3.8.1 source:gtag/jsloader usingtrackingID[0]—G-K7K215ZVNCstays first, so the loader URL is byte-identical to today's;gtag('config', …)per ID;gtag('event', 'page_view')on SPA route changes with nosend_to, so client-side navigations reach both destinations.The docs property keeps collecting exactly as before; nothing about its history changes.
Verifying
CI here runs the writing-style and structure checks but doesn't build the site, so the Vercel preview is the real check. On the preview, page source should contain both IDs, and the network tab should show two
/g/collectrequests — one pertid.Note previews build with
NODE_ENV=production, so the gtag plugin is active in them (as it already is today).