Getting Customer Aggregate Data

318 views
Skip to first unread message

Prototype.co

unread,
May 25, 2022, 10:43:33 AM5/25/22
to Google Ads API and AdWords API Forum
Hi all,

We are quite a bit stuck on retrieving some account (customer) level performance metrics, and I was wondering if you could help us out. In particular, we are looking to get this particular set of data from the online interface, using GAQL:
stats.jpg
Now, the problem is:
The "customer" resource provides data on this aggregate level, but it does NOT have a segment that we could use to segment the data on campaign type (here: advertising_channel_type).
The "campaign" resource DOES have a segment called advertising_channel_type, however, it returns data in an unaggregated form, one row per campaign resource name. This makes reaggregation of the data a pain, and, in the case of Search Impression Share, impossible (metrics like top impression % can be aggregated using impression weighted average, but search impression share, for some reason uses some unknown means of aggregation).

Is there some way to retrieve the above table directly with GAQL? If not, and we are forced to re-aggregate manually, is there a way to aggregate search impression share precisely?

Thank you for your assistance.

Google Ads API Forum Advisor

unread,
May 26, 2022, 11:02:45 AM5/26/22
to a...@prototype.co.hu, adwor...@googlegroups.com
Hi, 

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

With regard to your concern, could you please confirm if you mean that you want to get the metrics aggregated per campaign types. Unfortunately, there is no direct way to get this information that you are looking for. However, the workaround here is to create multiple reports using the campaign report. Then, for each report the campaign.advertising_channel_type is filtered by a specific enum corresponding to a specific campaign type. 

Best regards,
Google Logo
Jinky
Google Ads API Team
 


ref:_00D1U1174p._5004Q2bDP8o:ref

Prototype.co

unread,
May 26, 2022, 11:09:56 AM5/26/22
to Google Ads API and AdWords API Forum
Hi,

Thank you for your answer. Yes, I confirm that I want to get metrics aggregated on customer level, per campaign types.

So far, the only working solution we found was to set the summary_row_setting of SearchGoogleAdsStreamRequest to "SUMMARY_ROW_ONLY" and run the query on the campaign resource. However, this way we need one query each for every item in the enum AdvertisingChannelType. As you can see, this is far from ideal, as we end up with 11 queries only for this dataset per client. Considering we have other queries to run as well, and many clients to run queries for, this adds up the request count very fast.

Do you happen to know of a better solution?

Google Ads API Forum Advisor

unread,
May 27, 2022, 3:04:49 PM5/27/22
to a...@prototype.co.hu, adwor...@googlegroups.com
Hi Prototype,

Thank you for reaching out to the Google Ads API support team.

If you want to more report, you can apply for standard access. If you are using search/searchstream then you have to make separate queries. Let me know if you have any question.

Thanks,
Google Logo
Nirmita
Google Ads API Team
 


ref:_00D1U1174p._5004Q2bDP8o:ref

Prototype.co

unread,
Jun 30, 2022, 5:39:03 AM6/30/22
to Google Ads API and AdWords API Forum
Dear API Team,

sorry to bump this old thread, but our question is a direct follow-up to this particular thread, and the issue mentioned therein. Because of the issue mentioned above, we have no choice but to make a significant 21 SearchStream requests per client account (because we can only get aggregates using "SUMMARY_ROW_ONLY", we need separate requests for 3 date intervals, and 5 for the most common campaign types, that is 3×5 requests plus 6 requests for other purposes). This amounts to over a thousand SearchStream requests in a single run.

Now this would be technically impossible to pull off in a linear fashion, waiting for results would take far too long. Therefore, we use threading to send all requests at once, and await for the responses. It works, but at this volume, we get the following errors:

"""
File "\google\api_core\gapic_v1\method.py", line 154, in __call__
    return wrapped_func(*args, **kwargs)    raise exceptions.from_grpc_error(exc) from exc
    google.api_core.exceptions.ServiceUnavailable
File "\google\api_core\grpc_helpers.py", line 160, in error_remapped_callable:
     raise exceptions.from_grpc_error(exc) from exc
    google.api_core.exceptions.503 failed to connect to all addresses
    ServiceUnavailable: 503 failed to connect to all addresses
"""

What would be the right way to go about this issue? Note that if there was a way to get the above requested data directly, we could save 12 requests per client, cutting the request count to less than half the original. However, we're also fine with doing thousands of simultaneous SearchStream requests, but obviously that doesn't sound optimal.

Google Ads API Forum Advisor

unread,
Jun 30, 2022, 7:42:59 AM6/30/22
to a...@prototype.co.hu, adwor...@googlegroups.com
Hi Prototype,

Thank you for the reply.

Upon checking the error logs you have provided, This then appears to be more of a client library related issue. With this, since you are using python, I would recommend that you reach out to the client library owners via this link, to clarify what maybe causing this error.

Best regards,
Google Logo
Heidi
Google Ads API Team
 


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