Accounts under MCC with active campaigns

199 views
Skip to first unread message

Álvaro

unread,
Jan 26, 2022, 6:16:26 PM1/26/22
to Google Ads API and AdWords API Forum
Hi,

Im trying to migrate from Google Scripts to Google Ads API and can't figure out a way of getting all accounts with activity within the last 7 days. Im willing to avoig making requests to video_performance_report on those accounts without delivery.

Google Ads Scripts code:

var accountIterator = AdsManagerApp.accounts()
  .withCondition("Impressions > 0")
  .forDateRange("LAST_7_DAYS")
  .get();

and then I get the report on each account.

What I tried with the API:

$query = 'SELECT customer.id, metrics.impressions, customer.descriptive_name, customer.resource_name FROM customer WHERE metrics.impressions > 0';

but it throws the error "REQUESTED_METRICS_FOR_MANAGER".

Does this mean that I'll need to make a request for each ad account even if some of them have no activity? We have a lot of accounts with activity just a few days every month and we need to get this report on a daily basis.

What would be the best workaround to get this report (VIDEO_PERFORMANCE_REPORT) for all ad accounts with activity?

Thank you in advance,

Álvaro

unread,
Jan 26, 2022, 7:11:22 PM1/26/22
to Google Ads API and AdWords API Forum
Just updating that i tried also from customer_client:

SELECT customer_client.currency_code, customer_client.descriptive_name, metrics.impressions,
customer_client.id, customer_client.manager, customer_client.time_zone, segments.date
FROM customer_client
WHERE customer_client.manager = False AND segments.date DURING LAST_7_DAYS AND metrics.impressions > 0

with no success

Google Ads API Forum Advisor

unread,
Jan 27, 2022, 3:35:15 AM1/27/22
to api...@gmail.com, adwor...@googlegroups.com

Hello Álvaro,

Thank you for reaching out to us.

In the Google Ads API's perspective (REQUESTED_METRICS_FOR_MANAGER), metrics cannot be requested for a manager account. To retrieve metrics, issue separate requests against each client account under the manager account. For you to retrieve all accounts, you can refer to this Get Account Hierarchy guide for more details.

Regards,

Google Logo
Mark Kevin Albios
Google Ads API Team
 


ref:_00D1U1174p._5004Q2VPnKq:ref

Álvaro

unread,
Jan 27, 2022, 9:44:08 AM1/27/22
to Google Ads API and AdWords API Forum
Thank you for your answer
Reply all
Reply to author
Forward
0 new messages