Structuring a Google Ads query API call through an application.

68 views
Skip to first unread message

hazelnut_spread

unread,
Mar 23, 2023, 9:21:45 PM3/23/23
to Google Ads API and AdWords API Forum
Hello --

I'm trying to get metrics info for a specific client under an MCC manager account.

For example, the customer ID is XXXXXXXXXX -- but the account I want data for has the client ID ZZZZZZZZZZ.

When I set the query URL with my customer ID, it looks like this:

https://googleads.googleapis.com/v12/customers/XXXXXXXXXX/googleAds:searchStream

However, I'm met with the following response:

Service responded with exception status (400): [{ "error": { "code": 400, "message": "Request contains an invalid argument.", "status": "INVALID_ARGUMENT", "details": [ { "@type": "type.googleapis.com/google.ads.googleads.v12.errors.GoogleAdsFailure", "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." } ], "requestId": "HzsbDoMEWMzenQiYwIezsg" } ] } } ]

Given my input options, how could I go about "issue separate requests against each client account under the manager account"? It seems I can only set the customer ID in the query URL.

Thank you
FireShot Capture 370 - Edit Data Source - app.klipfolio.com.png

Google Ads API Forum Advisor

unread,
Mar 24, 2023, 2:09:10 AM3/24/23
to the...@eyeful.us, adwor...@googlegroups.com
Hi,

Thank you for raising this concern to the Google Ads API support team.

With regard to your concern, I am afraid that this is not possible in Google Ads API, it will give an query error REQUESTED_METRICS_FOR_MANAGER saying that Metrics cannot be requested for a manager account. To retrieve metrics, issue separate requests against each client account under the manager account as discussed in this document

Please note that report types of the Google Ads API reporting, especially with metrics, can only be requested against client accounts, not MCC. With this, I would suggest generating a report using a client account by indeed creating a new one that is under the said MCC account.

And to answer your question, if you are going to fetch a report with metrics, you will need to fetch a report via API using a certain client customer id. In addition, if you are using one of our supported client libraries, I suggest using a parallel report. This will allow you to run a query string for each customer ID. You may try this sample code on your end.

Kind regards,
Google Logo Google Ads API Team


ref:_00D1U1174p._5004Q2k2aY7:ref
Reply all
Reply to author
Forward
0 new messages