Will segment share the same anonymous IDs between two subdomains?
We are trying to understand if Segment share the same anonymous IDs between subdomains.
We have a following setup:
- example.com is our main domain, and it hosts a website with a blog and landing pages.
- dashboard.example.com is our app, users will signup and login there.
That's a great question.
Mark is really close! Segment's website library (analytics.js) automatically creates an anonymous id for a user who lands on your website and is not logged in. This id is accessible and stored in your browser's cookies; that way, the same anonymous id is associated with a user throughout the entire browsing session. Since the id is accessible through the cookies on the browser, it will persist through subdomains.
Here is a great link to our docs explaining more about how we use anonymous ids:
Thanks for writing in!