Google Ads API V1.0 Inclide Zero impressions and Segment.Date in select fields

370 views
Skip to first unread message

Priya

unread,
Apr 30, 2019, 9:32:50 AM4/30/19
to AdWords API and Google Ads API Forum
string query =
                $@"SELECT
                 ad_group_ad.ad.id,
                 campaign.id,
                 segments.date,
                 metrics.impressions,
                 metrics.clicks,
                 metrics.cost_micros,
                         metrics.average_position,
                FROM
                ad_group_ad
                WHERE segments.date BETWEEN '2019-04-17' AND '2019-04-28'              

I get zero impression without  segments.date in select field . 

How can I get  segments.date with zero impression in result when I query for a date range in Google Ads API V1.0  ? I am using .net client library. 

googleadsapi...@google.com

unread,
Apr 30, 2019, 1:35:38 PM4/30/19
to AdWords API and Google Ads API Forum
Hello Devi, 

You can exclude zero impressions from your query by specifying the metrics.impressions > 0 in the predicate. Please check this guide for more information.

Thanks,
Bharani, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

Message has been deleted

Priya

unread,
Apr 30, 2019, 5:41:09 PM4/30/19
to AdWords API and Google Ads API Forum
Thank you Bharani for your reply. can you please let me know if I can include zero impression data along with metrics.Date ?

The query listed below , returns rows containing non-zero values for "metrics.impressions" column. However if I remove "segments.date" from the select statement , all the records , including ones that contain zero "metrics.impressions" value are returned.

string query = $@"SELECT ad_group_ad.ad.id, campaign.id, segments.date, metrics.impressions, metrics.clicks, metrics.cost_micros, metrics.average_position, FROM ad_group_ad WHERE segments.date BETWEEN '2019-04-17' AND '2019-04-28'

I want to retrieve all the "metrics.impressions" rows by "segments.date". What should I do to modify the query listed above to return zero "metrics.impressions" rows along with "segments.date" value?

googleadsapi...@google.com

unread,
May 1, 2019, 9:48:48 AM5/1/19
to AdWords API and Google Ads API Forum
Hello Priya, 

Could you please share the client customer Id of the account to check this further? You can share the details privately via Reply privately to author option.

Regards,
Bharani, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Devi Priya

unread,
May 1, 2019, 1:36:44 PM5/1/19
to AdWords API and Google Ads API Forum
Hi Bharani , Can you please let me know why I am  not able to get zero impression in my report if I include a segments.Date ? This is a roadblock in our migration from Adwords to Google Ads APi v1.0. 
In adwords , I am able to get zero impressions along with date when IncludeZeroImpressions  is set to true.

Below is the query I am using to get ad performance report.
string query = $@"SELECT ad_group_ad.ad.idcampaign.id, segments.date, metrics.impressions, metrics.clicks, metrics.cost_micros, metrics.average_position FROM ad_group_ad WHERE segments.date BETWEEN '2019-04-17' AND '2019-04-28'  

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/32d53bac-e0a1-4281-9c3e-bf69ba1857f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

googleadsapi...@google.com

unread,
May 3, 2019, 8:26:41 AM5/3/19
to devip...@gmail.com, AdWords API and Google Ads API Forum
Hello,

Upon investigation, I have learned that this is intentional. You cannot get zero rows if you're requesting any segments in the search query. This essentially marks a clear delineation between two use cases. If you want a structural report (i.e. what campaigns, etc. exist), then you should not specify any segments in your query. If you want a statistical report (e.g. including impressions, etc.), then you're free to include segments to break down the report for your current use case, in which case zero rows are generally irrelevant.

Regards,
Mike, Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages