【发布时间】:2023-02-16 00:12:59
【问题描述】:
我正在尝试对 Fathom Analytics 进行 API 调用。但我无法弄清楚过滤选项(例如过滤特定路径名的报告)。有人可以帮我解决这个问题吗?
curl --location --request GET 'https://api.usefathom.com/v1/aggregations?entity=pageview&entity_id=[SITE_ID_HERE]&aggregates=visits, uniques, pageviews, avg_duration, bounce_rate' \
--header 'Authorization: Bearer [BEARER_TOKEN_HERE]'
如何在此处插入 json-payload 以使用 Fathom Filter 选项 (https://usefathom.com/api#aggregation)
另外,我在 python 中重建了 api 调用,但没有成功。当我从 API 调用中删除有效负载时,它工作正常。
import requests
endpoint = "https://api.usefathom.com/v1/aggregations?entity=pageview&entity_id=[SITE_ID]&aggregates=pageviews,visits,uniques,avg_duration,bounce_rate&date_from=2022-10-01&date_to=2022-10-31"
payload = [{"property": "pathname",
"operator": "is",
"value": "/[URL TO FILTER]"}]
headers = {
"Authorization": "[BEARER_TOKEN]"}
response=requests.get(endpoint, json=payload, headers=headers)
print(response.json())
【问题讨论】:
标签: python