how to get the keywordPlanId for api call

40 views
Skip to first unread message

Edwin

unread,
Aug 8, 2019, 1:31:06 AM8/8/19
to AdWords API and Google Ads API Forum
i am using the com.google.ads.googleads.v2.services.KeywordPlanServiceClient.generateHistoricalMetrics(String keywordPlan) to retrieve the historical stat data.
but i don't know how to get the keyword plan id for the parameter.  and in the example com.google.ads.googleads.examples.planning.GenerateForecastMetrics, the customer id is a long variable, is it the one like '123-123-1234' beside the account name?
thanks very much.

Google Ads API Forum Advisor Prod

unread,
Aug 8, 2019, 2:01:36 PM8/8/19
to 1587...@qq.com, adwor...@googlegroups.com

Hi Edwin,

Thank you for reaching out. You could use the KeywordPlan resource to get all the details related to Keyword Plan including the keyword plan id parameter. You could then use this keyword plan id to retrieve the historical statistics data. For your other concern, the client customer id is the same as the one you are referring to which is in the format XXX-XXX-XXXX. Let us know if you need additional information.

Regards,
Nikisha Patel, Google Ads API Team



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