Mixpanel数据导出由多个属性过滤

guz*_*man 4 python api rest mixpanel

我正在尝试使用其API的Mixpanel数据导出功能.

正如预期的那样,api会要求您将请求的参数发送到URL中,然后返回json响应.

实际的请求方法基本上如下:

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

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

以上仅导出设置搜索引擎的数据.除了这个规则之外,我如何包含其他过滤规则?Mixpanel文档在这个主题上似乎是免费的示例.

我试过以下:

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

但没有快乐(反应是空白的).

这里的任何帮助将不胜感激!

Xev*_*jol 5

Mixpanel Data Export API使用关键字/布尔运算符.

它在文档中有点隐藏,但你可以在Segmentation部分找到几个例子:https://mixpanel.com/docs/api-documentation/data-export-api#segmentation-default

所以你的例子将成为:

'where': 'properties["$property_name"]!="" and properties["$second_property_name"]=="value"'
Run Code Online (Sandbox Code Playgroud)