getting keyword id from search_term_view or keyword_view

324 views
Skip to first unread message

Yonatan

unread,
Mar 23, 2023, 8:29:12 AM3/23/23
to Google Ads API and AdWords API Forum
Hello,

How can I retrieve the keyword id from from search_term_view or keyword_view
I can easily get it in google ads scripts but not sure how to get it in google ads api

Google Ads API Forum Advisor

unread,
Mar 23, 2023, 9:15:34 AM3/23/23
to yon...@upsolver.com, adwor...@googlegroups.com

Hello,

Thank you for reaching out to the Google Ads API Support.

Please note that Keywords are Ad Group Criteria. While using keyword_view report, you may add the resource field “keyword_view.resource_name” in your query, since based on this reference document you are able to obtain the ad_group_id with criterion_id as keywordViews id, the format looks like this customers/{customer_id}/keywordViews/{ad_group_id}~{criterion_id}  from the resource name you have queried.

Alternetively, you may use keyword_view report and use ad_group_criterion.criterion_id field to get the keyword ID via reporting.

Here's the below sample GAQL:

SELECT ad_group_criterion.criterion_id FROM keyword_view

Let us know if you have any additional questions.

Regards,

Google Logo Google Ads API Team


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