Hi everyone,
with OAuth2 Playground i've been trying to send a POST request to access campaign data in a google ads test account (test account access), but always have been receiving the status message "REQUESTED_METRICS_FOR_MANAGER".
I tried to adjust the Request URI, switch manager customer id to account customer id or added other header without any result.
What do i need to change in the request to access account level and campaign level data?
Do i need to add the test account credentials to the cloud project?
Here is the full request & response:
POST /v11/customers/39xxxx/googleAds:searchStream HTTP/1.1
Host:
googleads.googleapis.com
Content-length: 381
Manager-customer-id: xxxxx Customer-id: xxxxx Developer-token: xxxxx Content-type: application/json
Authorization: Bearer ya29xxxxxx
{
"query": "SELECT
campaign.name,
campaign_budget.amount_micros,
campaign.status,
campaign.optimization_score,
campaign.advertising_channel_type,
metrics.clicks,
metrics.impressions,
metrics.ctr,
metrics.average_cpc,
metrics.cost_micros,
campaign.bidding_strategy_type
FROM campaign
WHERE segments.date DURING LAST_7_DAYS
AND campaign.status != 'REMOVED'"
}
HTTP/1.1 400 Bad Request
Content-length: 637
X-xss-protection: 0
X-content-type-options: nosniff
Transfer-encoding: chunked
Request-id: lOAGC-ddlL5Ve5mA_GhaPQ
Vary: Origin, X-Origin, Referer
Server: ESF
-content-encoding: gzip
Cache-control: private
Date: Thu, 14 Jul 2022 13:59:33 GMT
X-frame-options: SAMEORIGIN
Alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Content-type: application/json; charset=UTF-8[
{
"error": {
"status": "INVALID_ARGUMENT",
"message": "Request contains an invalid argument.",
"code": 400,
"details": [
{
"errors": [
{
"errorCode": {
"queryError": "REQUESTED_METRICS_FOR_MANAGER"
},
"message": "Metrics cannot be requested for a manager account. To retrieve metrics, issue separate requests against each client account under the manager account."
}
],
"@type": "
type.googleapis.com/google.ads.googleads.v11.errors.GoogleAdsFailure",
"requestId": "lOAGC-ddlL5Ve5mA_GhaPQ"
}
]
}
}
]
Thanks
Sebastian