Mixpanel: Data Export API gives different results and ranges to the web dashboard
Asked Answered
K

1

5

I'm getting different numbers in Mixpanel's dashboard and Data Export API.

In the dashboard on the segmentation tab, I've selected an event ("login"), start and end dates (Sept 17th and 24th), and the week unit. It shows a graph, and a table with four values, for this week, Sept 17th, Sept 10th and Sept 3rd.

I make this call to the Mixpanel API using the Python library:

api = Mixpanel(
    api_key = '----',
    api_secret = '----'
)

data = api.request(['segmentation'], {
    'event': 'login',
    'unit': 'week',
    'from_date': '2012-09-17',
    'to_date': '2012-09-24'
})

print json.dumps(data)

Here's the data it returns:

{
    "legend_size": 1,
    "data": {
        "series": [
            "2012-09-17",
            "2012-09-24"
        ],
        "values": {
            "login": {
                "2012-09-17": XXXXX,
                "2012-09-24": YYYYY
            }
        }
    }
}   

The value XXXXX is different to the value shown in the web dashboard, why is this?

The API is returning a value for Sept 24th which isn't in the dashboard view. The dashboard shows values for Sept 3rd and 10th which aren't in the API. Why is this happening?

How can I ensure the results are consistent between the two interfaces for the same date range?

Katharina answered 24/9, 2012 at 15:26 Comment(0)
P
18

Geddes from Mixpanel's Solutions Team here. The Mixpanel website actually uses the same APIs that we document publicly for your use, so one tip is to use Firebug / Chrome Inspector to view all the XHR requests on the Mixpanel page. You'll see the exact API query Mixpanel is using to get it's numbers, and you can compare that to your own API query, and it will become clear where the difference is.

Of course, we'd be more than happy to look at your case. If you can provide details like account name, event name, etc to [email protected] we can give you a more specific answer.

Best, Geddes

Purism answered 24/9, 2012 at 19:40 Comment(2)
Very very very useful comment - as I am trying to get my head round the API and now I can watch it. Super.Bindery
My segmentation event has properties. How can I query the properties using a segmentation query?Inwards

© 2022 - 2024 — McMap. All rights reserved.