analytics: cross-subdomain identity for the unified onboarding funnel#3968
Open
vibegui wants to merge 1 commit into
Open
analytics: cross-subdomain identity for the unified onboarding funnel#3968vibegui wants to merge 1 commit into
vibegui wants to merge 1 commit into
Conversation
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)
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
Pin
cross_subdomain_cookie: truein 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) andstudio.decocms.com(this app) share the.decocms.comroot domain, so one PostHog project + a root-scoped cookie = the samepersonacross 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 ontouser_signed_up. No manual cross-project stitching.Studio already runs on the target project (id
394178), and posthog-js defaultscross_subdomain_cookieto 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 + hosthttps://us.i.posthog.comin 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: truein the PostHog browser init to scope the cookie to.decocms.com, making visitors the same person acrosswww.decocms.comandstudio.decocms.com. This secures cross-subdomain identity for a single acquisition → signup funnel and prevents future config regressions; no behavior change on its own.www.decocms.com) to the same PostHog project as Studio (394178) with hosthttps://us.i.posthog.com.user_signed_upautomatically.Written for commit 3982216. Summary will update on new commits.