我想在谷歌分析中建立自己的同类群组。我可以在指标列表中指定自己的指标吗?默认指标如下:
如果是,该怎么办?如果不是,那么如何记录这些预定义指标的数据?
答案 0 :(得分:0)
Analytics Reporting API V4:
您可以使用Analytics Reporting API V4构建群组请求
例如:
POST https://analyticsreporting.googleapis.com/v4/reports:batchGet
{
"reportRequests":
[
{
"viewId": "XXXX",
"dimensions":
[
{
"name": "ga:cohort"
},
{
"name": "ga:cohortNthDay"
}
],
"metrics":
[
{
"expression": "ga:cohortActiveUsers"
},
{
"expression": "ga:transactions"
}
],
"cohortGroup":
{
"cohorts":
[
{
"name": "cohort 1",
"type": "FIRST_VISIT_DATE",
"dateRange":
{
"startDate": "2015-08-01",
"endDate": "2015-08-01"
}
},
{
"name": "cohort 2",
"type": "FIRST_VISIT_DATE",
"dateRange":
{
"startDate": "2015-07-01",
"endDate": "2015-07-01"
}
}
]
}
}
]
}
See the API explorer for an example
并非所有维度和指标都可以一起查询。例如,您将无法查询ga:transactionsPerUser
和ga:cohortActiveUsers
。请参阅Dimensions and metric explorer,了解可以一起查询的维度。