The number of rows returned is different between selecting "segments.date" or not

87 views
Skip to first unread message

Boris Zhao

unread,
Jan 7, 2022, 12:55:03 AM1/7/22
to AdWords API and Google Ads API Forum
Hi,

The number of rows returned are different between if I'm selecting "segment.date" or not. 

For example, 
1. With this GAQL, only 1 row is returned:
SELECT ad_group.id, campaign.id, ad_group_criterion.criterion_id, ad_group_criterion.system_serving_status, ad_group_criterion.keyword.match_type, segments.date 
FROM keyword_view 
WHERE ad_group_criterion.keyword.match_type IN ('EXACT','BROAD') 
AND ad_group_criterion.system_serving_status = 'RARELY_SERVED' 
AND ad_group_criterion.status IN ('ENABLED') 
AND ad_group.status IN ('ENABLED','PAUSED') 
AND campaign.status IN ('ENABLED','PAUSED') 
AND segments.date BETWEEN '2021-12-13' AND '2021-12-13'

2. But with this one, 49395 rows are returned:
SELECT ad_group.id, campaign.id, ad_group_criterion.criterion_id, ad_group_criterion.system_serving_status, ad_group_criterion.keyword.match_type 
FROM keyword_view 
WHERE ad_group_criterion.keyword.match_type IN ('EXACT','BROAD') 
AND ad_group_criterion.system_serving_status = 'RARELY_SERVED' 
AND ad_group_criterion.status IN ('ENABLED') 
AND ad_group.status IN ('ENABLED','PAUSED') 
AND campaign.status IN ('ENABLED','PAUSED') 
AND segments.date BETWEEN '2021-12-13' AND '2021-12-13'

Could you help check why is that happening? 

Thanks,
Boris

Google Ads API Forum Advisor

unread,
Jan 7, 2022, 4:07:54 AM1/7/22
to bor...@stubhubcorp.com, adwor...@googlegroups.com
Hi Boris,

Thank you for reaching out to our team.

Could you try adding the metrics.impressions field in the query and observe if the value of each row for this field is 0 or more than zero? I asked this because the possible reason for the issue is "zero impressions are always excluded when segmenting a report" according to this document.

However, so that I can check on my end, could you provide the complete request and response logs with request ID and request header generated on your end?

You can provide it via Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q2UhTcn:ref

Boris Zhao

unread,
Jan 10, 2022, 12:42:08 AM1/10/22
to AdWords API and Google Ads API Forum
Hi Ernie,

Thank you for the reply!

Yes, the different is caused by the zero impressions. 

I thought the zero impressions will always be excluded when I'm using the segments.date in the WHERE clause. Turns out that I misunderstood the document. 

Regards,
Boris

Reply all
Reply to author
Forward
0 new messages