Forecast metrics provide metrics for proposed or existing campaigns, including:
- Impressions
- Click through rate
- Average cost per click
- Clicks
- Cost
Experiment with different campaign configurations to optimize each of these metrics. Data such as historical quality score and click through rate may be used in the forecast to simulate expected performance, such as the conversion rate.
Forecast metrics are usually used after historical metrics . Historical metrics reduce a large keyword list to a more manageable size. Forecast metrics provide a more exact estimate of future campaign performance. Start with historical metrics for keywords. Once the list is manageable, use forecast metrics to optimize the performance of your campaign.
Generate metrics
To generate forecast metrics, complete these steps:
- Construct a campaign that you want to forecast
CampaignToForecast
. - Call
KeywordPlanIdeaService.GenerateKeywordForecastMetrics
with thatCampaignToForecast
and any other parameters, such asforecast_period
.
Create a campaign to forecast
Here are some tips when creating your campaign to forecast:
- Create the ad groups based on themes such as creative relevance, product category, or cost per click.
- Include common negative keywords. For example if you are not in recruitment, exclude the keyword 'jobs'.
- Use an account which is related to the campaign. Don't forecast from an unrelated account. Google factors in things like quality score and creative content into the forecast.
- If a campaign is unrelated to the rest of your account, use a new clean account for the forecast.
- Repeat forecasts with different horizons to get a holistic picture.
Generate forecast metrics
The next code example makes a request to KeywordPlanIdeaService.GenerateKeywordForecastMetrics
. It
then iterates through each of the results and displays each of the forecast
metrics.
The response can also return temporary
IDs
in the resource—for example, customers/CUSTOMER_ID/keywordPlanCampaigns/-1
.
Java
private void runExample ( GoogleAdsClient googleAdsClient , Long customerId ) { CampaignToForecast campaignToForecast = createCampaignToForecast ( googleAdsClient ); GenerateKeywordForecastMetricsRequest request = GenerateKeywordForecastMetricsRequest . newBuilder () . setCustomerId ( String . valueOf ( customerId )) . setCampaign ( campaignToForecast ) . setForecastPeriod ( DateRange . newBuilder () // Sets the forecast start date to tomorrow. . setStartDate ( new DateTime (). plusDays ( 1 ). toString ( "yyyy-MM-dd" )) // Sets the forecast end date to 30 days from today. . setEndDate ( new DateTime (). plusDays ( 30 ). toString ( "yyyy-MM-dd" ))) . build (); try ( KeywordPlanIdeaServiceClient keywordPlanIdeaServiceClient = googleAdsClient . getLatestVersion (). createKeywordPlanIdeaServiceClient ()) { GenerateKeywordForecastMetricsResponse response = keywordPlanIdeaServiceClient . generateKeywordForecastMetrics ( request ); KeywordForecastMetrics metrics = response . getCampaignForecastMetrics (); System . out . printf ( "Estimated daily clicks: %s%n" , metrics . hasClicks () ? metrics . getClicks () : null ); System . out . printf ( "Estimated daily impressions: %s%n" , metrics . hasImpressions () ? metrics . getImpressions () : null ); System . out . printf ( "Estimated average CPC (micros): %s%n" , metrics . hasAverageCpcMicros () ? metrics . getAverageCpcMicros () : null ); } } /** * Creates the campaign to forecast. A campaign to forecast lets you try out various * configurations and keywords to find the best optimization for your future campaigns. Once * you've found the best campaign configuration, create a serving campaign in your Google Ads * account with similar values and keywords. For more details, see: * * <p>https://support.google.com/google-ads/answer/3022575 * * @param googleAdsClient * @return */ private CampaignToForecast createCampaignToForecast ( GoogleAdsClient googleAdsClient ) { CampaignToForecast . Builder campaignToForecastBuilder = CampaignToForecast . newBuilder () . setKeywordPlanNetwork ( KeywordPlanNetwork . GOOGLE_SEARCH ) . setBiddingStrategy ( CampaignBiddingStrategy . newBuilder () . setManualCpcBiddingStrategy ( ManualCpcBiddingStrategy . newBuilder (). setMaxCpcBidMicros ( 1_000_000L ))); // See https://developers.google.com/google-ads/api/reference/data/geotargets for the list of // geo target IDs. campaignToForecastBuilder . addGeoModifiers ( CriterionBidModifier . newBuilder () // Geo target constant 2840 is for USA. . setGeoTargetConstant ( ResourceNames . geoTargetConstant ( 2840 ))); // See https://developers.google.com/google-ads/api/reference/data/codes-formats#languages for // the list of language criteria IDs. Language constant 1000 is for English. campaignToForecastBuilder . addLanguageConstants ( ResourceNames . languageConstant ( 1000 )); // Create forecast ad group based on themes such as creative relevance, product category, or // cost per click. ForecastAdGroup . Builder forecastAdGroupBuilder = ForecastAdGroup . newBuilder (); forecastAdGroupBuilder . addBiddableKeywords ( BiddableKeyword . newBuilder () . setMaxCpcBidMicros ( 2_500_000 ) . setKeyword ( KeywordInfo . newBuilder () . setText ( "mars cruise" ) . setMatchType ( KeywordMatchType . BROAD ))); forecastAdGroupBuilder . addBiddableKeywords ( BiddableKeyword . newBuilder () . setMaxCpcBidMicros ( 1_500_000 ) . setKeyword ( KeywordInfo . newBuilder () . setText ( "cheap cruise" ) . setMatchType ( KeywordMatchType . PHRASE ))); forecastAdGroupBuilder . addBiddableKeywords ( BiddableKeyword . newBuilder () . setMaxCpcBidMicros ( 1_990_000 ) . setKeyword ( KeywordInfo . newBuilder () . setText ( "jupiter cruise" ) . setMatchType ( KeywordMatchType . BROAD ))); forecastAdGroupBuilder . addNegativeKeywords ( KeywordInfo . newBuilder (). setText ( "moon walk" ). setMatchType ( KeywordMatchType . BROAD )); campaignToForecastBuilder . addAdGroups ( forecastAdGroupBuilder . build ()); return campaignToForecastBuilder . build (); }
C#
public void Run ( GoogleAdsClient client , long customerId ) { CampaignToForecast campaignToForecast = CreateCampaignToForecast (); KeywordPlanIdeaServiceClient keywordPlanIdeaService = client . GetService ( Services . V21 . KeywordPlanIdeaService ); GenerateKeywordForecastMetricsRequest request = new GenerateKeywordForecastMetricsRequest () { CustomerId = customerId . ToString (), Campaign = campaignToForecast , ForecastPeriod = new DateRange () { // Set the forecast start date to tomorrow. StartDate = DateTime . Now . AddDays ( 1 ). ToString ( "yyyy-MM-dd" ), // Set the forecast end date to 30 days from today. EndDate = DateTime . Now . AddDays ( 30 ). ToString ( "yyyy-MM-dd" ), } }; try { GenerateKeywordForecastMetricsResponse response = keywordPlanIdeaService . GenerateKeywordForecastMetrics ( request ); KeywordForecastMetrics metrics = response . CampaignForecastMetrics ; Console . WriteLine ( $"Estimated daily clicks: {metrics.Clicks}." ); Console . WriteLine ( $"Estimated daily impressions: {metrics.Impressions}." ); Console . WriteLine ( $"Estimated average cpc (micros): {metrics.AverageCpcMicros}." ); } catch ( GoogleAdsException e ) { Console . WriteLine ( "Failure:" ); Console . WriteLine ( $"Message: {e.Message}" ); Console . WriteLine ( $"Failure: {e.Failure}" ); Console . WriteLine ( $"Request ID: {e.RequestId}" ); throw ; } } /// <summary> /// Creates the campaign to forecast. A campaign to forecast lets you try out /// various configuration and keywords to find the best optimization for your /// future campaigns. Once you've found the best campaign configuration, /// create a serving campaign in your Google Ads account with similar values /// and keywords. For more details, see: /// https://support.google.com/google-ads/answer/3022575 /// </summary> private CampaignToForecast CreateCampaignToForecast () { CampaignToForecast campaignToForecast = new CampaignToForecast () { KeywordPlanNetwork = KeywordPlanNetwork . GoogleSearch , BiddingStrategy = new CampaignToForecast . Types . CampaignBiddingStrategy () { ManualCpcBiddingStrategy = new ManualCpcBiddingStrategy () { MaxCpcBidMicros = 1 _000_000 } } }; // See https://developers.google.com/google-ads/api/reference/data/geotargets // for the list of geo target IDs. campaignToForecast . GeoModifiers . Add ( new CriterionBidModifier () { // Geo target constant 2840 is for USA. GeoTargetConstant = ResourceNames . GeoTargetConstant ( 2840 ) }); // See https://developers.google.com/google-ads/api/reference/data/codes-formats#languages // for the list of language criteria IDs. // Language constant 1000 is for English. campaignToForecast . LanguageConstants . Add ( ResourceNames . LanguageConstant ( 1000 )); // Create forecast ad group based on themes such as creative relevance, product category, // or cost per click. ForecastAdGroup forecastAdGroup = new ForecastAdGroup (); forecastAdGroup . BiddableKeywords . Add ( new BiddableKeyword () { MaxCpcBidMicros = 2 _500_000 , Keyword = new KeywordInfo () { Text = "mars cruise" , MatchType = KeywordMatchType . Broad } }); forecastAdGroup . BiddableKeywords . Add ( new BiddableKeyword () { MaxCpcBidMicros = 1 _500_000 , Keyword = new KeywordInfo () { Text = "cheap cruise" , MatchType = KeywordMatchType . Phrase } }); forecastAdGroup . BiddableKeywords . Add ( new BiddableKeyword () { MaxCpcBidMicros = 1 _990_000 , Keyword = new KeywordInfo () { Text = "jupiter cruise" , MatchType = KeywordMatchType . Broad } }); forecastAdGroup . NegativeKeywords . Add ( new KeywordInfo () { Text = "moon walk" , MatchType = KeywordMatchType . Broad }); campaignToForecast . AdGroups . Add ( forecastAdGroup ); return campaignToForecast ; }
PHP
public static function runExample( GoogleAdsClient $googleAdsClient, int $customerId ): void { $campaignToForecast = self::createCampaignToForecast(); $keywordPlanIdeaServiceClient = $googleAdsClient->getKeywordPlanIdeaServiceClient(); // Generates keyword forecast metrics based on the specified parameters. $response = $keywordPlanIdeaServiceClient->generateKeywordForecastMetrics( new GenerateKeywordForecastMetricsRequest([ 'customer_id' => $customerId, 'campaign' => $campaignToForecast, 'forecast_period' => new DateRange([ // Sets the forecast start date to tomorrow. 'start_date' => date('Ymd', strtotime('+1 day')), // Sets the forecast end date to 30 days from today. 'end_date' => date('Ymd', strtotime('+30 days')) ]) ]) ); $metrics = $response->getCampaignForecastMetrics(); printf( "Estimated daily clicks: %s%s", $metrics->hasClicks() ? sprintf("%.2f", $metrics->getClicks()) : "'none'", PHP_EOL ); printf( "Estimated daily impressions: %s%s", $metrics->hasImpressions() ? sprintf("%.2f", $metrics->getImpressions()) : "'none'", PHP_EOL ); printf( "Estimated average CPC (micros): %s%s", $metrics->hasAverageCpcMicros() ? sprintf("%d", $metrics->getAverageCpcMicros()) : "'none'", PHP_EOL ); } /** * Creates the campaign to forecast. A campaign to forecast lets you try out various * configurations and keywords to find the best optimization for your future campaigns. Once * you've found the best campaign configuration, create a serving campaign in your Google Ads * account with similar values and keywords. For more details, see: * * https://support.google.com/google-ads/answer/3022575 * * @return CampaignToForecast the created campaign to forecast */ private static function createCampaignToForecast(): CampaignToForecast { // Creates a campaign to forecast. $campaignToForecast = new CampaignToForecast([ 'keyword_plan_network' => KeywordPlanNetwork::GOOGLE_SEARCH, 'bidding_strategy' => new CampaignBiddingStrategy([ 'manual_cpc_bidding_strategy' => new ManualCpcBiddingStrategy([ 'max_cpc_bid_micros' => 1_000_000 ]) ]), // See https://developers.google.com/google-ads/api/reference/data/geotargets for the // list of geo target IDs. 'geo_modifiers' => [ new CriterionBidModifier([ // Geo target constant 2840 is for USA. 'geo_target_constant' => ResourceNames::forGeoTargetConstant(2840) ]) ], // See // https://developers.google.com/google-ads/api/reference/data/codes-formats#languages // for the list of language criteria IDs. Language constant 1000 is for English. 'language_constants' => [ResourceNames::forLanguageConstant(1000)], ]); // Creates forecast ad group based on themes such as creative relevance, product category, // or cost per click. $forecastAdGroup = new ForecastAdGroup([ 'biddable_keywords' => [ new BiddableKeyword([ 'max_cpc_bid_micros' => 2_500_000, 'keyword' => new KeywordInfo([ 'text' => 'mars cruise', 'match_type' => KeywordMatchType::BROAD ]) ]), new BiddableKeyword([ 'max_cpc_bid_micros' => 1_500_000, 'keyword' => new KeywordInfo([ 'text' => 'cheap cruise', 'match_type' => KeywordMatchType::PHRASE ]) ]), new BiddableKeyword([ 'max_cpc_bid_micros' => 1_990_000, 'keyword' => new KeywordInfo([ 'text' => 'jupiter cruise', 'match_type' => KeywordMatchType::BROAD ]) ]) ], 'negative_keywords' => [ new KeywordInfo([ 'text' => 'moon walk', 'match_type' => KeywordMatchType::BROAD ]) ] ]); $campaignToForecast->setAdGroups([$forecastAdGroup]); return $campaignToForecast; }