SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

How Does Analytics.js Track Users Across Subdomains?

Question

How does Analytics.js track users across subdomains?

 

Product

Segment

 

Environment

Segment Console

 

Answer

Analytics.js tracks users across subdomains by default. To enable this, include the Analytics.js snippet on each subdomain you want to track. Segment sets the anonymousId on the top-level domain, allowing the same anonymousId to be accessed by all subdomains and ensuring consistent user tracking.

You can use either the same Segment source for all subdomains or separate sources, depending on your tracking goals.

 

Additional Information 

Tracking across different top-level domains is not supported out of the box. To track users across top-level domains, use Segment’s Querystring API to pass the anonymousId in the URL. Analytics.js will read and set the anonymousId from the query string when a user moves between domains.

Have more questions? Submit a request
Powered by Zendesk