Mixpanel Community Icon

Discrepancy Between Mixpanel API Data and Dashboard Events

·
·

I am downloading my events data using this API https://data.mixpanel.com/api/2.0/export , but the number of events returned is double what shows on my dashboard in mixpanel for the same date range. why is that ?

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    Hi Zeyad Y., 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

  • Avatar of kapa.ai
    kapa.ai
    APP
    ·
    ·

    There are several possible reasons why you're seeing twice as many events in your API export compared to your Mixpanel dashboard. Based on the knowledge sources, here are the most likely causes:

    Disjoint Event Duplicates

    You might be experiencing what Mixpanel calls "disjoint event duplicates." This happens when the same event is tracked multiple times in your code, perhaps by different engineers or in different parts of your application (front-end and back-end).As explained in the Mixpanel blog: "The simplest [reason] is that the event was tracked, mistakenly, in two different places in your code, perhaps by two different engineers. Alternatively, it could have been tracked once in the app code that lives on the device and then again on the server when your app requested the song." Common Technical Hiccups in Your Product Analytics

    Different Filtering in Dashboard vs. API

    The dashboard might have filters applied that aren't present in your API request. The Raw Event Export API returns all events without any filtering that might be applied in your dashboard views.

    Hidden Events

    Your dashboard might be hiding certain events that are still included in the API export. As mentioned in the documentation: "Mixpanel exports all events to your destination, even ones that are hidden in the UI via Lexicon." Data Pipelines FAQ

    Different Calculations

    Different Mixpanel reports calculate data in different ways. Your dashboard might be showing unique user counts while your API export is returning total event counts. As the documentation states: "While the Insights report may be counting the total event count ('Total Events'), the funnel report may be counting based on unique user count ('Uniques')." Debugging: Data DiscrepanciesTo debug this issue, I recommend: 1. Check if you have any filters applied in your dashboard that aren't in your API request 2. Verify if you're comparing the same metrics (total events vs. unique users) 3. Look for patterns in the duplicated events to identify if they're being tracked in multiple places 4. Check if any events are hidden in your Lexicon settings but still appearing in the API exportIf you need to further investigate, you can use the CSV export feature to compare with your API results and identify specific discrepancies.

    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.

  • Avatar of Andrew S.
    Andrew S.
    ·
    ·

    Zeyad Y. I just went through this. Search through your export results for an "insert_id" and see if there are duplicates. I found, for reasons I could not take the time to figure out (was it something with the API or something with my export script code), that I had duplicates (sometimes triplicates) of events in my exported JSONL file. So I wrote some scripts in python to dedupe the results. the $insert_id property on evrents should be a unique code only appearing 1x

  • Avatar of Zeyad Y.
    Zeyad Y.
    ·
    ·

    Andrew S. Thanks for the reply! This is exactly what I ended up doing.