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!

有帮助吗?

解决方案

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"'
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top