Google Analytics(分析)查询与视图相关的维度和指标列表

问题描述 投票:0回答:1

[我正在尝试使用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'}]的正文中提及维度和指标列表。但是...

python google-analytics google-api-client google-reporting-api
1个回答
0
投票

在这里您可以找到可在Analytics(分析)中为任何视图查询的所有指标和维度的列表:https://ga-dev-tools.appspot.com/dimensions-metrics-explorer/

© www.soinside.com 2019 - 2024. All rights reserved.