Subdomains and other domains
Subdomains of one site share users and sessions on their own. Separate domains link through sign in.
Subdomains: automatic
The SDK writes its cookies on your registrable domain, so www.example.sa, app.example.sa and shop.example.sa share one Guest ID and one session. Install the SDK with the same project key on each, and allow each one in the sites allowed to send. *.example.sa allows every subdomain; add example.sa too if the bare domain serves pages.
// the same key on www.example.sa and app.example.sa
datacub.init('pk_live_YOUR_PROJECT_KEY')Different domains: through identify
example.sa and example.com cannot share a cookie, so a user is a separate Guest on each. When they sign in on both, datacub.identify with the same user ID links both to one Registered user.
datacub does not pass IDs between domains in links or URLs. That would put an identifier in the address bar, in referrers and in other tools' logs.
Website and app
The same applies to your website and your mobile app: separate Guests, linked when the user signs in to both with the same ID. Use one project for both if you want them in the same reports; allow the site and the app in Settings, General.