Skip to content

analytics: send docs pageviews to the canonical litellm.ai GA4 property - #1441

Merged
eleanor-berri merged 1 commit into
mainfrom
analytics/add-marketing-ga4-property
Sep 12, 2026
Merged

analytics: send docs pageviews to the canonical litellm.ai GA4 property#1441
eleanor-berri merged 1 commit into
mainfrom
analytics/add-marketing-ga4-property

Conversation

@eleanor-berri

Copy link
Copy Markdown
Contributor

What

Adds G-G3LG9H6J6B as a second GA4 destination alongside the existing docs property G-K7K215ZVNC.

Why

docs.litellm.ai is a subdomain of litellm.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 _ga cookie is already shared.

Behaviour

@docusaurus/plugin-google-gtag normalises trackingID to an array and, per its 3.8.1 source:

  • loads a single gtag/js loader using trackingID[0]G-K7K215ZVNC stays first, so the loader URL is byte-identical to today's;
  • emits one gtag('config', …) per ID;
  • fires gtag('event', 'page_view') on SPA route changes with no send_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/collect requests — one per tid.

Note previews build with NODE_ENV=production, so the gtag plugin is active in them (as it already is today).

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.
@vercel

vercel Bot commented Sep 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
litellm Ready Ready Preview Sep 12, 2026 5:08pm UTC

Request Review

@eleanor-berri
eleanor-berri merged commit 0380510 into main Sep 12, 2026
4 checks passed
@eleanor-berri
eleanor-berri deleted the analytics/add-marketing-ga4-property branch September 12, 2026 17:37
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.

1 participant