What's wrong with this query

48 views
Skip to first unread message

Dihan Cheng

unread,
Jul 16, 2020, 12:50:57 AM7/16/20
to AdWords API and Google Ads API Forum
Hi, I'm trying to select the following fields from resource ad_group_ad , it's working before I add segments.date, wondering what is wrong. I've used the interactive gaql builder, the following query is valid from the builder.
SELECT ad_group.id,ad_group.name,campaign.id,campaign.name,campaign.advertising_channel_type,customer.id,ad_group_ad.ad.id,ad_group_ad.ad.name,ad_group_ad.status,ad_group_ad.policy_summary,ad_group_ad.ad.tracking_url_template,ad_group_ad.ad.final_url_suffix,ad_group_ad.ad.url_custom_parameters,ad_group_ad.ad.display_url,ad_group_ad.ad.final_urls,ad_group_ad.ad.final_app_urls,ad_group_ad.ad.final_mobile_urls,ad_group_ad.ad.display_url,ad_group_ad.ad.type,ad_group_ad.ad.device_preference,ad_group_ad.ad.url_collections,ad_group_ad.ad_strength,ad_group_ad.ad.text_ad.description1,ad_group_ad.ad.text_ad.description2,ad_group_ad.ad.text_ad.headline,segments.date FROM ad_group_ad

thanks for any help

Dihan Cheng

unread,
Jul 16, 2020, 1:29:30 AM7/16/20
to AdWords API and Google Ads API Forum
actually even the simplest form does not work, 

SELECT ad_group_ad.ad.id, segments.date FROM ad_group_ad

Google Ads API Forum Advisor Prod

unread,
Jul 16, 2020, 9:10:17 AM7/16/20
to dch...@newengen.com, adwor...@googlegroups.com
Hello,

If you are selecting the field segments.date, you should also include a date range. Let me know if you still face issues after including this.

Cheers,
Anthony
Google Ads API Team 

ref:_00D1U1174p._5004Q21mSY4:ref

Dihan Cheng

unread,
Jul 16, 2020, 9:31:32 AM7/16/20
to AdWords API and Google Ads API Forum
Hi Anthony,

Thanks for helping! Is it possible to include date range only with segments.date <= "some date" ? I want to get all the entities before current date, but I don't know about the starting date.

Dihan

Google Ads API Forum Advisor Prod

unread,
Jul 16, 2020, 10:32:39 AM7/16/20
to dch...@newengen.com, adwor...@googlegroups.com
Hi Dihan,

You should give both start and end date when using the date field. If you don't know the start date of your account, you can navigate to your account and choose the date range All Time. It will show you the start date.

Dihan Cheng

unread,
Jul 17, 2020, 7:34:42 AM7/17/20
to AdWords API and Google Ads API Forum
thank you!
Reply all
Reply to author
Forward
0 new messages