我正在尝试在Core Reporting API V4查询中使用多个dimensionFilterClauses。如果我只在ga:adwordsCustomerID维度上使用一个过滤器,一切都很好,但是当我在ga:adTargetingType维度上添加第二个过滤器时,它会抛出“状态400:错误请求”的错误。
这是我编写的查询:
你知道上面的查询体有什么问题吗?
这是我编写的查询:
return analytics.reports().batchGet(
body={"reportRequests": [{
"pageSize": 10000,
"viewId": VIEW_ID,
"dateRanges": [
{"startDate": "31daysAgo", "endDate": "yesterday"}
],
"dimensions": [
{"name": "ga:adwordsCampaignID"},
{"name": "ga:adwordsAdGroupID"},
{"name": "ga:adwordsCriteriaID"}
],
"metrics": [
{"expression": "ga:adClicks"},
{"expression": "ga:adCost"},
{"expression": "ga:uniquePurchases"},
{"expression": "ga:itemRevenue"},
{"expression": "ga:CPC"},
{"expression": "ga:ROAS"}
],
"dimensionFilterClauses": [
{"filters": [
{"dimensionName": "ga:adwordsCustomerID",
"operator": "EXACT",
"expressions": ["2096809090"]},
{"dimensionName": "ga:adTargetingType",
"operator": "EXACT",
"expressions": ["Keyword"]}
]}
],
"metricFilterClauses": [
{"filters": [
{"metricName": "ga:adCost",
"operator": "GREATER_THAN",
"comparisonValue": "0"}
]}
],
"orderBys": [
{"fieldName": "ga:adClicks",
"sortOrder": "DESCENDING"}
]}
]}
).execute()
你知道上面的查询体有什么问题吗?
error.resp.message
而不仅仅是原因。最好包括完整的错误响应。我在下面发布了一个带有两个DimensionFilterClauses
的示例。如果你明白了,请在这里回复。 - Matt