What is the right way to calculate anonymous users on my site?
Hi Nitya G., 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
Short answer: Count unique users who have only anonymous identifiers (no known user_id) within your chosen time window.How to do this in Mixpanel depends on your ID setup: - If you use Simplified ID Merge: - Anonymous events have $device_id but no $user_id, and their distinct_id is set to the $device_id (prefixed as $device: in clusters). [Identifying (Simplified); Migrating to Simplified] - Practically, to calculate anonymous users for a period (e.g., MAU): - In an Insights report, choose your “active” event(s), set the measurement to Unique Users (or MAU/WAU/DAU via advanced controls), and filter to events where $user_id does not exist. This yields unique users who were only anonymous during those events in that period. [Insights: Users]- If you use Original ID Merge: - Anonymous events are tracked under an anonymous distinct_id until you call identify/merge. [Identifying (Original)] - You can similarly count unique users by filtering for events without a known ID (i.e., before $identify is sent), but the docs don’t specify a dedicated filter field beyond distinct_id conventions, so prefer Simplified where possible. The knowledge sources do not explicitly document a ready-made filter for “anonymous only” in Original.Notes and considerations: - MTU includes anonymous visitors; your MTU count for a month will already reflect unique anonymous and known users combined. To isolate anonymous only, apply the filter above. [MTU billing; MTU overview] - For MAU/WAU/DAU, Mixpanel counts unique users who performed the selected event within the rolling window; use advanced controls in Insights to compute XAU after applying your anonymous filter. [Insights: Users]If you’re unsure which identity API you’re on, check your project’s ID management version first. [Identifying (Simplified)]
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.
kapa.ai I’m trying to understand how many users are anonymous on my site. Right now, I’m capturing all events and then filtering for cases where userId is either not set or is an empty string. But the numbers I see are surprisingly low—ideally, they should be greater than the count of active users. Can anyone help me understand the right way to calculate anonymous users?
Let me check the knowledge base for you again. One moment! 📚
You’re on the right track conceptually, but a few Mixpanel identity nuances can make “anonymous users” undercounted if you only filter for userId being null/empty.What “anonymous” means in Mixpanel - In projects using Simplified ID Merge, anonymous events carry $device_id but no $user_id. When both appear together once, Mixpanel merges them and sets distinct_id to the $user_id going forward. [Identifying (Simplified); Migrating to Simplified] - So “anonymous users” for a time window = unique users who generated events that had $device_id present and no $user_id.How to calculate in Mixpanel (Simplified ID Merge) - In Insights: 1) Choose the event(s) that define “active” for you. 2) Set the metric to Unique Users (or DAU/WAU/MAU as needed). [MAU in Mixpanel] 3) Add a filter: $user_id does not exist (and optionally $user_id != “” if your pipeline sometimes sends empty strings). This returns unique users who were anonymous when performing those events in that period. [Identifying (Simplified)]Why your current count can be “surprisingly low” - If users log in during the same period, their events after the login will have $user_id and be counted as identified for those events. Only their pre-login events will meet your “anonymous” filter. This is expected. [Identifying (Simplified)] - If you’re comparing Funnels vs. Insights, remember Funnels can count unique users or conversions, while Insights may be counting total events unless you switch to Unique Users—mismatched aggregations cause discrepancies. [Data discrepancies] - Timezone or filter differences between reports also create gaps—remove filters to baseline, then re-add. [Data discrepancies]Server-side or Original API notes - Server-side (Simplified): Do not set distinct_id yourself—send $device_id for anonymous events and both $device_id and $user_id after login; Mixpanel derives distinct_id. This ensures proper merging and accurate anonymous filtering by $user_id existence. [Server-side (Simplified)]
- Original API projects behave differently (use $identify/$create_alias/$merge). The sources don’t provide a dedicated “anonymous only” filter beyond identity events, so if you’re on Original, confirm your API version and be cautious interpreting anonymous counts. [Identifying (Original)]Practical checklist - Verify which ID Merge API your project uses, then apply the method above. [Identifying (Simplified)] - In your events, confirm that anonymous hits truly lack $user_id and include $device_id. - In Insights, switch your metric to Unique Users/MAU before filtering. - If numbers still look off, sanity-check with an unfiltered view, then add the “$user_id does not exist” filter to isolate where the discrepancy appears. [Data discrepancies]If you share which identity API you’re on and an example event, I can help fine-tune the exact filter.
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.
