This repository was archived by the owner on Jun 23, 2026. It is now read-only.
fix: share Mixpanel identity across *.thegrid.ai subdomains#73
Open
CastilloLuis wants to merge 1 commit into
Open
fix: share Mixpanel identity across *.thegrid.ai subdomains#73CastilloLuis wants to merge 1 commit into
CastilloLuis wants to merge 1 commit into
Conversation
Switch Mixpanel persistence to a cross-subdomain cookie so agentsea (agentsea.thegrid.ai) shares one distinct_id with the app, landing, and manifesto properties (all on the same prod token). Previously the origin-scoped localStorage store minted a separate identity per subdomain, inflating unique user counts and breaking cross-property funnels/attribution. Set persistence: "cookie" + cross_subdomain_cookie: true (the latter is a no-op without the former). save_referrer: false is kept, so the first-touch source seeding remains the sole writer of $initial_referring_domain. Co-authored-by: Cursor <cursoragent@cursor.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
localStorageto a cross-subdomain cookie so agentsea (agentsea.thegrid.ai) shares a singledistinct_idwith the other*.thegrid.aiproperties (app, landing, manifesto) — all on the same prod token.persistence: "cookie"+cross_subdomain_cookie: true(the latter is a no-op without the former).save_referrer: false, so first-touch source seeding remains the sole writer of$initial_referring_domain(no OAuth/Stripe referrer-clobber risk here).Why
Previously each subdomain minted its own anonymous identity, inflating unique user counts and breaking cross-property funnels/retention/attribution. This matches the cross-subdomain cookie config already shipped in grid-ui, the landing page, and the manifesto (The-Grid PR #76).
Test plan
agentsea.thegrid.ai, confirm the Mixpanel cookie is scoped to.thegrid.ai(DevTools → Application → Cookies) and thedistinct_idmatches one carried over fromapp.thegrid.ai.distinct_id(no new identity).$initial_referring_domainreflects the real first-touch source, not an internal subdomain.Made with Cursor