Question

I'm trying to use the Mixpanel Data Export functionality of their API.

The api as expected asks you to send the parameters of your request into the URL and then returns a json response.

The actual request method basically works as below:

data = api.request(['export'], {
    'event': ['event_name'],
    'from_date': from_date,
    'to_date': to_date,
    'where': 'properties["$property_name"]!=""'
    })

'where': 'properties["$Search Engine"]!=""'

The above only exports data where the search engine is set. How do I include another filtering rule in addition to this one? The Mixpanel documentation seems to be pretty example free on this topic.

I've tried the below:

data = api.request(['export'], {
    'event': ['event_name'],
    'from_date': from_date,
    'to_date': to_date,
    'where': 'properties["$property_name"]!=""&properties["$second_property_name"]=="value"'
    })

But with no joy (the response is blank).

Any assistance here would be much appreciated!

Was it helpful?

Solution

Mixpanel Data Export API uses the keywords and / or as boolean operators.

It's a bit tucked away in the documentation, but you can find a couple examples under the Segmentation section: https://mixpanel.com/docs/api-documentation/data-export-api#segmentation-default

So your example would become:

'where': 'properties["$property_name"]!="" and properties["$second_property_name"]=="value"'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top