问题描述
环境
在使用 Amplitude 进行电子商务应用数据分析期间,我需要下载多个用户条件仪表板并进行比较。
我的仪表板是用
制作的- 采用的事件路径 > 结束于 > target_event(例如购买)。
- 由用户执行>
该用户的总付费 > X
该用户的总顺序 > Y - 有很多(186)个隐藏的事件
- 假设振幅仪表板的唯一 ID 是 aaaabb。
我正在做我的工作 jupyterlab。
我想要
下载并比较多棵树,每棵树的不同是X,Y。
喜欢。
import requests
import json
def get_item(x,y):
p1 = json.dumps({'filters':[{
#filter user only much than total sales X
'prop':'total_sales_of_this_user','op':'gt','values':[f'{x}']},{
#filter user only much than total bought count Y
'prop':'total_bought_count_of_this_user','values':[f'{y}']},]},ensure_ascii=False)
pa = (('e',p1),)
return requests.get(
'https://analytics.amplitude.com/api/3/chart/aaaabb/query',params=pa,auth=('amplitude_access_key','amplitude_secret_key') ).json()
xys = sum([[(x,y) for y in [1,10,100,1000]] for x in [1,1000] ],[])
#action
results = [get_item(x,y) for x,y in xys]
但此操作返回所有相同的结果。
就像它忽略了我的参数。
问题
如果我在 Amplitude Web 控制台中制作了许多仅不同 x、y 的图表并向每个不同的图表请求 api,我可以获得我想要的结果。但我想要自动化解决方案。 (使用参数或其他)。
如何在 Amplitude 仪表板 api 中控制用户细分条件?
引用者
https://developers.amplitude.com/docs/dashboard-rest-api
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)