How to get method to generate metrics forecast ?

60 views
Skip to first unread message

Emanuele Lucchese

unread,
Jun 16, 2023, 5:14:16 PM6/16/23
to Google Ads API and AdWords API Forum
I can't find the api that does the same thing as this service. https://ads.google.com/aw/keywordplanner/plan/forecast

I would need to generate an advertising campaign forecast.
I need to get the following data:
Average cost per click
Estimate of clicks
Conversion estimation
Estimate of clicks on the link
Coverage estimate.

I'm using the php libraries released by google but I can't find the methods and classes that allow me to do this.

This link seems to be right for me https://developers.google.com/google-ads/api/docs/keyword-planning/generate-forecast-metrics?hl=it But there are no methods and classes for php .. How come ?

Emanuele Lucchese

unread,
Jun 21, 2023, 11:31:44 AM6/21/23
to Google Ads API Forum Advisor, adwor...@googlegroups.com
Thank you for your support.

I implemented your solution but this error returns.
Request with ID 'vW80ZGRV9zsEE1GeeYxCIw' has failed. Google Ads failure details: request_error: Invalid customer ID ''.

As customer id I set: 7060933953
While as login-customer-id I put that of the account manager: 4537258414.

I can't figure out where the problem is.

Could it be that I'm using a test and not a development token?

Il giorno mar 20 giu 2023 alle ore 20:47 Google Ads API Forum Advisor <ads...@forumsupport.google> ha scritto:

Hi there,

Thanks for reaching out to the Google Ads API Forum.

Kindly note that the KeywordPlanIdeaService.GenerateKeywordForecastMetrics has similar functionality in the Google Ads UI Keyword Planner, and Forecast metrics provide metrics for proposed or existing campaigns, including:

  • Impressions
  • Click through rate
  • Average cost per click
  • Clicks
  • Cost

To generate forecast metrics, you may see the steps below:

  1. Construct a campaign that you want to forecast CampaignToForecast.
  2. Call KeywordPlanIdeaService.GenerateKeywordForecastMetrics with that CampaignToForecast and any other parameters, such as forecast_period.

For the available sample PHP code related to the planning services, you may check this link under Planning. Let us know if you have any additional questions. 

This message is in relation to case "ref:_00D1U1174p._5004Q2mUkRu:ref"

Thanks,
 
Google Logo Google Ads API Team


Google Ads API Forum Advisor

unread,
Jun 22, 2023, 1:07:31 PM6/22/23
to lucchese.e...@gmail.com, adwor...@googlegroups.com

Hello,

Thanks for getting back to us.

You may note that the request_error: Invalid customer ID '' is not a developer token related. I have checked accounts 7060933953 and 4537258414 and both are valid Ads accounts. However, for us to investigate why you encountered a request_error: Invalid customer ID '', our team requires the complete request and response logs with the request-id generated for API error. Could you provide these full logs?

To enable logging, you may refer here https://developers.google.com/google-ads/api/docs/best-practices/logging

Once you capture logs in the above format, kindly provide the requested logs via reply privately to author option. 

Reply all
Reply to author
Forward
0 new messages