문제

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?

도움이 되었습니까?

해결책

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 support@mixpanel.com we can give you a more specific answer.

Best, Geddes

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top