[我正在尝试使用python google-api-client提取Google分析数据。但我需要在请求正文中提及维度和指标列表'dimensions':[{'name':'ga:date'}]] >>。但是有什么方法可以获取与视图ID相关联的维度和指标的完整列表。我可以通过API调用获取该列表吗?
sample_request = {
'viewId': 'xxxxxx',
'dateRanges': [{'startDate': '7daysAgo', 'endDate': 'today'}],
'metrics' : [{'expression' : 'ga:users'}],
'dimensions':[{'name' : 'ga:date'}]
}
response = api_client.reports().batchGet(
body={
'reportRequests': sample_request
}).execute()
[我正在尝试使用python google-api-client提取Google分析数据。但是我需要在请求'dimensions':[{'name':'ga:date'}]的正文中提及维度和指标列表。但是...
在这里您可以找到可在Analytics(分析)中为任何视图查询的所有指标和维度的列表:https://ga-dev-tools.appspot.com/dimensions-metrics-explorer/