Skip to content

analytics: cross-subdomain identity for the unified onboarding funnel#3968

Open
vibegui wants to merge 1 commit into
mainfrom
posthog-cross-subdomain-funnel
Open

analytics: cross-subdomain identity for the unified onboarding funnel#3968
vibegui wants to merge 1 commit into
mainfrom
posthog-cross-subdomain-funnel

Conversation

@vibegui

@vibegui vibegui commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

What

Pin cross_subdomain_cookie: true in the browser PostHog init (apps/mesh/src/web/lib/posthog-client.ts).

Why

We're unifying deco's acquisition → signup funnel into one PostHog project (Option A). www.decocms.com (landing) and studio.decocms.com (this app) share the .decocms.com root domain, so one PostHog project + a root-scoped cookie = the same person across both surfaces — a visitor who lands on www and signs up in Studio becomes a single identity, with first-touch attribution ($initial_utm_*, referrer) carried automatically onto user_signed_up. No manual cross-project stitching.

Studio already runs on the target project (id 394178), and posthog-js defaults cross_subdomain_cookie to true — this PR just pins it explicitly so a future config change can't silently break cross-domain identity. Behavior is unchanged on its own.

The other half (required for this to do anything)

The landing must be pointed at the same PostHog project key as Studio. That PR is on deco-sites/decocms, plus an ops step: set the landing's PostHog key Secret to Studio's project (394178) key + host https://us.i.posthog.com in the deco admin. Until both share the key, the cookie won't match and the funnel stays split.

Risk

None in isolation (explicit default). The funnel only changes once the landing is re-pointed.

🤖 Generated with Claude Code


Summary by cubic

Pins cross_subdomain_cookie: true in the PostHog browser init to scope the cookie to .decocms.com, making visitors the same person across www.decocms.com and studio.decocms.com. This secures cross-subdomain identity for a single acquisition → signup funnel and prevents future config regressions; no behavior change on its own.

  • Migration
    • Point the landing (www.decocms.com) to the same PostHog project as Studio (394178) with host https://us.i.posthog.com.
    • Once both share the project key, UTMs/referrer will flow into user_signed_up automatically.

Written for commit 3982216. Summary will update on new commits.

Review in cubic

Part of unifying deco's acquisition → signup funnel into one PostHog project
(Option A). studio.decocms.com and www.decocms.com share the `.decocms.com`
root domain, so a single PostHog project + a root-scoped cookie makes a
visitor the SAME person across the landing and the app — no manual
cross-project stitching.

Studio already runs on the target project; this just pins
`cross_subdomain_cookie: true` (posthog-js' default) so it can't silently
regress and break cross-domain identity. The matching change lands on the
landing (deco-sites/decocms), which must be pointed at this same project key.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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