Differece in the number of rows

36 views
Skip to first unread message

asad mhagne

unread,
Jan 22, 2023, 12:10:08 PM1/22/23
to Google Ads API and AdWords API Forum

I am currently utilizing the Google Ads API to retrieve data from the Video table. Upon attempting to add the ad_group_ad.ad.type dimension in the SELECT clause, I have noticed an increase in the number of rows returned. However, after performing aggregation, the results remain unchanged. I am curious as to the reason for this behavior and if it is expected. Can you provide insight on this matter?

The query:
SELECT segments.date, customer.currency_code, campaign.id, campaign.name, ad_group.id, ad_group.name, metrics.clicks, metrics.cost_micros, metrics.engagements, metrics.impressions, video.duration_millis, metrics.video_quartile_p100_rate, metrics.video_quartile_p25_rate, metrics.video_quartile_p50_rate, metrics.video_quartile_p75_rate, metrics.video_views, segments.ad_network_type, ad_group_ad.ad.type FROM video

Thanks,
Asa'd

Google Ads API Forum Advisor

unread,
Jan 23, 2023, 12:18:29 AM1/23/23
to asad.k...@gmail.com, adwor...@googlegroups.com

Hi Asad,

Thanks for reaching out to the Google Ads API Forum.

Since you mentioned attempting to add the ad_group_ad.ad.type dimension in the SELECT clause, an increase in the number of rows for your provided GAQL. I’ve checked your GAQL, and it’s not valid as seen below:

 

 

Upon checking, kindly note that the field ad_group_ad.ad.type is a segments field as report ad_group_ad is segmented to video report. You may check the following scenario if it is happening on your end:

  1. Zero metrics are always excluded when segmenting a report, provided all selected metrics are zero
  2. Any segment fields from your select clause in the GAQL query filters that segment is telling the query to only get the rows of data said segments fields.


Note that zero metrics campaigns records shown on Ads UI, however, Google Ads API excludes and does not pull when segmenting a report, provided all selected metrics are zero. You may check here for more information. Also, when any segments fields are added to a query with FROM ad_group_ad, that segment is telling the query to only get the rows of data that have said segments field, and remove any row that is not associated. These both scenarios may also affect in combination with each other. That being said, you may double check on your end if for the given dates in a date range, if there are zero metrics for a given date range, then the API doesn't pull the row if the row is segmented and has no metrics for that date range. 

If the above scenario is not happening, then you may provide the following details via reply privately to author option:

  • Complete request and response logs with request ID generated for said report
  • Complete Ads UI screenshot without cropping showing date filters 


Regards, 

Google Logo
Yasar
Google Ads API Team
 

 

 



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