Hi, We are getting an issue where device id (mixpanel properties) of our domain 1 is different from device id of domain 2 due to which different events are being dropped for the same user. Can someone please help with this issue? cc Muhammad U.
Hi Nameer, Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> 👋
Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai
This behavior is expected: by default, each browser / domain gets its own anonymous ID ($device_id / distinct_id), so the same person on two domains will look like two separate users unless you do identity management across domains.Because you’re seeing “dropped” users across events, you’re likely: - Looking at Funnels / Retention, which follow users by distinct_id[Identity overview]
- And not yet sharing IDs or calling identify() consistently across both domains.There are two complementary fixes, depending on how your project is configured: ---
1. If you’re on Original ID Merge – use cross-domain tracking
For Original ID Merge, pass the Mixpanel distinct_id from domain 1 to domain 2, then call identify() on domain 2 with that same ID, so both domains share a single identity cluster[Cross-domain tracking]: On domain 1 (sender): js // Get current Mixpanel distinct_id var distinctId = mixpanel.get_distinct_id(); var destinationUrl = "[https://second-domain.com](https://second-domain.com)"; var urlWithDistinctId = destinationUrl + (destinationUrl.indexOf('?') !== -1 ? '&' : '?') + "distinct_id=" + encodeURIComponent(distinctId); window.location.href = urlWithDistinctId;LBKSOn domain 2 (receiver): js var urlParams = new URLSearchParams(window.location.search); var distinctId = urlParams.get('distinct_id'); if (distinctId) { mixpanel.identify(distinctId); }LBKSNow events from both domains will share the same distinct_id, so funnels and other reports can join the journey[Identity overview].---
2. If you’re on Simplified ID Merge – rely on $user_id and identify()
With Simplified ID Merge, the main unifier is $user_id, not $device_id. It’s expected that $device_id differs per browser / domain; Mixpanel merges them once a $user_id is seen with each $device_id[Identifying users simplified].Best practice: 1. On both domains, let the SDK create its own $device_id for anonymous users.
2. On registration / login (and whenever the app opens in a logged‑in state), call:
js
mixpanel.identify(USER_ID); // same USER_ID across both domains
```LBKSLBKS This sets `$user_id` for that browser and merges that `$device_id` into the same identity cluster[[Identifying users simplified](https://docs.mixpanel.com/docs/tracking-methods/id-management/identifying-users-simplified#mechanism); [Best practices simplified](https://docs.mixpanel.com/docs/tracking-methods/id-management/identifying-users-simplified#best-practices)].LBKS3. Ensure **both domains use the same stable `USER_ID`** (e.g. DB ID). Once each domain has sent at least one event where its own `$device_id` and that same `$user_id` appear together, Mixpanel will retroactively join those pre‑login events to the user[[Example flows](https://docs.mixpanel.com/docs/tracking-methods/id-management/identifying-users-simplified#example-user-flows)].LBKSNote: it can take **up to 24 hours** for merges to show consistently across all reports, though a single user’s Activity Feed updates in near real time[[Simplified FAQ](https://docs.mixpanel.com/docs/tracking-methods/id-management/identifying-users-simplified#faq)].LBKS---
3. How to confirm and debug
To verify this is an ID issue and not something else: 1. Compare Unique users vs Total events in your reports; a mismatch usually points to identity problems[Debugging discrepancies]. 2. Pick a single user and: - Look at their profile / Activity Feed and confirm whether events from both domains appear under one user or two[Simplified FAQ]. 3. Temporarily remove filters in your reports to see if discrepancies persist[Data discrepancies].---If you can share: - Whether your project is on Original or Simplified ID Merge, and - Whether the user is logged in on both domains,I can suggest a more concrete per‑SDK snippet for your setup.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
