gpt4 book ai didi

google-analytics - Google Analytics Reporting API V4 生命周期值(value)请求 - 无效的维度/指标

转载 作者:行者123 更新时间:2023-12-03 15:52:35 24 4
gpt4 key购买 nike

我正在尝试调用 Analytics Reporting API V4并在尝试使用某些维度和指标时不断收到不具体的错误消息。例如,我一直得到

{
"error": {
"code": 400,
"message": "Unknown dimension(s): ga:acquisitionTrafficChannel",
"status": "INVALID_ARGUMENT"
}
}

通过时 ga:acquisitionTrafficChannel ,尽管它是 documented as a valid dimension .同样,我得到
{
"error": {
"code": 400,
"message": "Selected dimensions and metrics cannot be queried together.",
"status": "INVALID_ARGUMENT"
}
}

通过时 ga:acquisitionSourceMedium ( documented here ),即使没有通过任何指标。

文档过时了吗?其他地方是否有一些关于维度和指标的有效组合的文档?

最佳答案

所有Lifetime Value reports因此 ga:acquisition... dimensions仅对 App views 有效不是 WebView 。

其次,群组/LTV 维度只能在 cohort requests 内查询。例如:

POST https://analyticsreporting.googleapis.com/v4/reports:batchGet
{
"reportRequests": [
{
"viewId": "XXXX",
"dimensions": [
{
"name": "ga:cohort"
},
{
"name": "ga:acquisitionTrafficChannel"
}
],
"metrics": [
{
"expression": "ga:cohortSessionsPerUser"
}
],
"cohortGroup": {
"cohorts": [
{
"name": "cohort 1",
"type": "FIRST_VISIT_DATE",
"dateRange": {
"startDate": "2015-08-01",
"endDate": "2015-09-01"
}
},
{
"name": "cohort 2",
"type": "FIRST_VISIT_DATE",
"dateRange": {
"startDate": "2015-07-01",
"endDate": "2015-08-01"
}
}
],
"lifetimeValue": true
}
}
]
}

错误消息可能应该更清楚一些。

关于google-analytics - Google Analytics Reporting API V4 生命周期值(value)请求 - 无效的维度/指标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36598815/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com