Google Ads API (googleAds:searchStream) weird results

207 views
Skip to first unread message

Christian Adam

unread,
Nov 11, 2022, 2:28:34 PM11/11/22
to Google Ads API and AdWords API Forum
Hi Google Team,

I'm making use of the Google Ads API, and more precisely the Google Ads Service and I'm getting weird results.

I'm executing a POST request like this:

URL:
 {{GOOGLE_API_ENDPOINT}}/v{{API_VERSION}}/customers/{{CUSTOMER_ID}}/googleAds:searchStream

BODY:
{
"query": "SELECT metrics.impressions, asset.id, ad_group.resource_name, ad_group.type, asset.type, ad_group_ad_asset_view.field_type FROM ad_group_ad_asset_view WHERE segments.date = '2022-11-09' AND ad_group_ad_asset_view.field_type = 'HEADLINE' AND ad_group_ad.ad.id = <specific ad id>"
}

And I can see 15 headlines being shown!

Now if I select `segments.date` to be part of the result:

BODY:
{
"query": "SELECT metrics.impressions, asset.id, ad_group.resource_name, ad_group.type, asset.type, ad_group_ad_asset_view.field_type, segments.date FROM ad_group_ad_asset_view WHERE segments.date = '2022-11-09' AND ad_group_ad_asset_view.field_type = 'HEADLINE' AND ad_group_ad.ad.id = <specific ad id>"
}

I get only 13 results!.

This is weird, as the headlines returned for the same ad varies depending on the fields I select? 
Shouldn't I always get 15 headlines in this case? Could this be a bug in the API?

Thanks!!

Christian -

Google Ads API Forum Advisor

unread,
Nov 11, 2022, 3:21:43 PM11/11/22
to christian.a...@taxfix.de, adwor...@googlegroups.com
Hi Christina,

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

To investigate the issue further, could you please provide the complete request and response logs, with the request-id? If you haven't yet, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link.
Could you please provide full screen screenshot of the UI which data you want to pull?

You can provide it via Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead. Let me know if you have any questions.

Thanks,
Google Logo
Nirmita
Google Ads API Team
 


ref:_00D1U1174p._5004Q2g2wUC:ref

Christian Adam

unread,
Nov 15, 2022, 7:24:22 AM11/15/22
to Google Ads API and AdWords API Forum
Hi there!

I did reply with "Reply to Author" only with the full request/response. Just checking in to know if you got it.

Thanks!

Christian -

Google Ads API Forum Advisor

unread,
Nov 15, 2022, 11:28:55 AM11/15/22
to christian.a...@taxfix.de, adwor...@googlegroups.com
Hi Christian,

Thank you for your follow up. Our team was able to receive the details you provided privately and I was also able to respond to you yesterday, directly to the email address you used when sending the details.

That said, if you have not seen my response yet, below are its contents :

"Thank you for your reply and for the additional details you have included.

The behavior you are encountering is due to the Google Ads API's handling of zero metrics. Based on this section, if the metrics field(s) that you include in your SELECT are zero and if you included a segments field, then those zero metrics are automatically excluded from the results.

In your SELECT query, only the metrics.impressions is included, and in your results, there are currently two records where the metrics.impressions = 0. This is now why only 13 records are returned when you include the segments.date field in the SELECT.

That said, I would also like to recommend that you check out our segmentation guide, for more insight on how the API's reports would behave if segments fields are included in your queries.

I hope this helps.
"

Best regards,

Google Logo
Peter Laurence
Google Ads API Team
 


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