How to get keyword ID from the Google Ads API?

1,188 views
Skip to first unread message

johnny...@costaleads.com

unread,
Apr 29, 2019, 5:20:41 PM4/29/19
to AdWords API and Google Ads API Forum
I am using the following query:

{ query : "SELECT campaign.id, campaign.name, ad_group.id, ad_group.name, ad_group_criterion.criterion_id, ad_group_criterion.keyword.text, ad_group_criterion.status, metrics.impressions, metrics.clicks, metrics.conversions, metrics.cost_micros, metrics.ctr, metrics.conversions_from_interactions_rate, metrics.average_cpc, metrics.cost_per_conversion, segments.date FROM keyword_view WHERE segments.date BETWEEN '2019-01-01' AND '2019-01-01' AND metrics.impressions > 0" }

and I get this result:

results.png


However, I dont understand how to also get the KEYWORD ID in the results.

johnny...@costaleads.com

unread,
Apr 30, 2019, 2:01:12 PM4/30/19
to AdWords API and Google Ads API Forum
These are the results, in text for better visibility;

campaignCollection
resourceName customers/123-123-1234/campaigns/1466683191
id 1466683191
name CL - Search - Generic - UK - EN
adGroupCollection
resourceName customers/123-123-1234/adGroups/56506182866
id 56506182866
name apartment san pedro
metricsCollection
clicks 0
conversions 0
costMicros 0
ctr 0
impressions 2
adGroupCriterionCollection
resourceName customers/123-123-1234/adGroupCriteria/56506182866~306978744910
status ENABLED
criterionId 306978744910
keywordCollection
text +apartment +san +pedro
keywordViewCollection
resourceName customers/123-123-1234/keywordViews/56506182866~306978744910
segmentsCollection
date 2019-01-01


I dont have any Keyword ID in there, only Keyword Text.
How do I call the Keyword ID?

Thanks.

googleadsapi...@google.com

unread,
Apr 30, 2019, 2:58:54 PM4/30/19
to johnny...@costaleads.com, AdWords API and Google Ads API Forum
Hi Johnny,

The keyword ID should come from the field ad_group_criterion.criterion_id, which you included in your report query. Can you please provide your CID through reply privately to author so I can take a closer look?

Thanks,
Anthony
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/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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+unsubscribe@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+unsubscribe@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/6959364c-0d63-4039-af58-e0959e5b8aff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

johnny...@costaleads.com

unread,
May 1, 2019, 9:52:19 AM5/1/19
to AdWords API and Google Ads API Forum
That is all I needed to know. Slightly confusing not calling it Keyword ID.
Thank you for your help. :-)

/Johnny

On Monday, April 29, 2019 at 11:20:41 PM UTC+2, johnny...@costaleads.com wrote:
Reply all
Reply to author
Forward
0 new messages