How can we calculate the average distinct count of a specific event per user per session?
Hi JH. K., 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
To calculate the average distinct count of a specific event per user per session in Mixpanel, you can leverage the available aggregation and measurement options in the Insights report: 1. Sessions as a Unit of Analysis: Mixpanel allows you to aggregate data by sessions. In Insights, you can use the “Session Start” and “Session End” events to analyze metrics at the session level, such as the total number of sessions, average session length, and session-based event counts. You can also count the number of sessions that contained a particular event by selecting Sessions as the aggregation method for your event in the Insights query builder. This will show you, for example, how many sessions included a specific event like "Product Purchase" Session Controls in Reports.2. Distinct Count per User: Mixpanel’s Insights report supports “Aggregate Property per User” measurements, including the distinct count of property values per user. This allows you to answer questions like “How many different videos did each user watch?” and then aggregate those per-user values (e.g., average, median, percentiles) Aggregate Property per User.3. Combining Per-Session and Per-User Analysis: While Mixpanel natively supports per-user and per-session aggregations, the knowledge sources do not explicitly mention a built-in function to directly calculate the average distinct count of a specific event per user per session in a single step. However, you can approach this by: - Breaking down your event by session and user in Insights. - Using the “distinct count” measurement for your event property (e.g., event name or another identifier). - Aggregating the results by user and then by session, and finally taking the average. For example, you would: - Select your event in Insights. - Set the measurement to “Distinct count” of the event property. - Break down by both user and session. - Aggregate the distinct counts per user per session, and then compute the average.Note: If you need more advanced or custom calculations (such as chaining aggregations across both user and session dimensions), you may need to use JQL (JavaScript Query Language) for more flexibility, but the knowledge sources do not provide a direct JQL example for this specific calculation.Summary:
Mixpanel provides the tools to analyze distinct event counts per user and per session, and you can use breakdowns and aggregations in Insights to approximate the average distinct count of a specific event per user per session. However, there is no explicit, out-of-the-box function for this exact metric; you may need to combine breakdowns and aggregations manually in Insights Session Controls in Reports Aggregate Property per User.
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.