Get more out of your budget with improved bids, keywords, and ads
Increase the overall performance and efficiency of your campaigns
To increase optimization scores, you can use theRecommendationServiceto retrieve
recommendations, and then apply or dismiss them accordingly. You can also
subscribe toautomatically applyrecommendations by using theRecommendationSubscriptionService.
Optimization scoreis an
estimate of how well your Google Ads account is set to perform and is available
at theCustomerandCampaignlevels.
TheCustomer.optimization_score_weightis only available for non-manager accounts and is used to compute the overall
optimization score of multiple accounts. Retrieve the optimization score and
optimization score weight of the accounts and multiply them together
(Customer.optimization_score * Customer.optimization_score_weight) to compute
the overall optimization score.
There are optimization-related metrics available forcustomerandcampaignreports:
Themetrics.optimization_score_urlprovides a deep link into the account to view information on the related
recommendations in the Google Ads UI.
Themetrics.optimization_score_uplifttells how much the optimization score would increase if all related
recommendations are applied. It's an estimate based on all available
recommendations as a whole, not just the sum of the uplift scores for each
recommendation.
To group and order the returned recommendations, you can segment both of these
metrics by recommendation type usingsegments.recommendation_typein your
query.
Migrate Dynamic Search Ads to Performance Max campaigns
PERFORMANCE_MAX_OPT_IN
Create Performance Max campaigns in your account
IMPROVE_PERFORMANCE_MAX_AD_STRENGTH
Improve the asset group strength of a Performance Max campaign to an
"Excellent" rating
PERFORMANCE_MAX_FINAL_URL_OPT_IN
Turn on Final URL expansion for your Performance Max campaigns
RAISE_TARGET_CPA_BID_TOO_LOW
Raise target CPA when it is too low and there are
very few or no conversions
FORECASTING_SET_TARGET_ROAS
Raise the budget in advance of a seasonal event
that is forecasted to increase traffic, and change bidding strategy
from maximize conversion value to target ROAS
LEAD_FORM_ASSET
Add lead form assets to a campaign
CALLOUT_ASSET
Add callout assets to campaign or customer level
SITELINK_ASSET
Add sitelink assets to campaign or customer level
CALL_ASSET
Add call assets to campaign or customer level
SHOPPING_ADD_AGE_GROUP
Add the age group attribute to offers that are demoted because of a
missing age group
SHOPPING_ADD_COLOR
Add a color to offers that are demoted because of a missing
color
SHOPPING_ADD_GENDER
Add a gender to offers that are demoted because of a missing
gender
SHOPPING_ADD_GTIN
Add a GTIN (Global Trade Item Number) to offers that are demoted
because of a missing GTIN
SHOPPING_ADD_MORE_IDENTIFIERS
Add more identifiers to offers that are demoted because of missing
identifiers
SHOPPING_ADD_SIZE
Add the size to offers that are demoted because of a missing
size
SHOPPING_ADD_PRODUCTS_TO_CAMPAIGN
Add products for a campaign to serve
SHOPPING_FIX_DISAPPROVED_PRODUCTS
Fix disapproved products
SHOPPING_TARGET_ALL_OFFERS
Create a catch-all campaign that targets all offers
For each type of recommendation, details are provided in a
recommendation-specific field. For example,CAMPAIGN_BUDGETrecommendation
details are in thecampaign_budget_recommendationfield, and are wrapped in aCampaignBudgetRecommendationobject.
Find all recommendation-specific fields in therecommendationunion field.
Recommendation impact
Some recommendation types populate theimpactfield of the recommendation.RecommendationImpactcontains an estimate of the impact on account performance as a result of
applying the recommendation. The followingrecommendation metricsare
available in theimpact.base_metricsandimpact.potential_metricsfields:
impressions
clicks
cost_micros
conversions
all_conversions
video_views
Even when theimpactfield is populated, metrics availability varies depending
on the recommendation type and campaign type, among other factors. In general,
check for availability of each impact metric before trying to use it.
Code example
The following sample code retrieves all available and dismissed recommendations
of typeKEYWORDfrom an account and prints some of their details:
googleads_service=client.get_service("GoogleAdsService")query:str="""SELECTrecommendation.campaign,recommendation.keyword_recommendationFROM recommendationWHERErecommendation.type = KEYWORD"""# Detects keyword recommendations that exist for the customer account.response:Iterable[GoogleAdsRow]=googleads_service.search(customer_id=customer_id,query=query)operations:List[ApplyRecommendationOperation]=[]forrowinresponse:recommendation=row.recommendationprint(f"Keyword recommendation ('{recommendation.resource_name}') "f"was found for campaign '{recommendation.campaign}.")keyword=recommendation.keyword_recommendation.keywordprint(f"\tKeyword = '{keyword.text}'\n"f"\tType = '{keyword.match_type}'")# Create an ApplyRecommendationOperation that will be used to apply# this recommendation, and add it to the list of operations.operations.append(build_recommendation_operation(client,recommendation.resource_name))
query=<<~QUERYSELECTrecommendation.resource_name,recommendation.campaign,recommendation.keyword_recommendationFROMrecommendationWHERErecommendation.type=KEYWORDQUERYgoogle_ads_service=client.service.google_adsresponse=google_ads_service.search(customer_id:customer_id,query:query,)operations=response.eachdo|row|recommendation=row.recommendationputs"Keyword recommendation ('#{recommendation.resource_name}') was found for "\"campaign '#{recommendation.campaign}'."ifrecommendation.keyword_recommendationkeyword=recommendation.keyword_recommendation.keywordputs"\tKeyword = '#{keyword.text}'"puts"\ttype = '#{keyword.match_type}'"endbuild_recommendation_operation(client,recommendation.resource_name)end
# Create the search query.my$search_query="SELECT recommendation.resource_name, "."recommendation.campaign, recommendation.keyword_recommendation "."FROM recommendation "."WHERE recommendation.type = KEYWORD";# Get the GoogleAdsService.my$google_ads_service=$api_client->GoogleAdsService();my$search_stream_handler=Google::Ads::GoogleAds::Utils::SearchStreamHandler->new({service=>$google_ads_service,request=>{customerId=>$customer_id,query=>$search_query}});# Create apply operations for all the recommendations found.my$apply_recommendation_operations=();$search_stream_handler->process_contents(sub{my$google_ads_row=shift;my$recommendation=$google_ads_row->{recommendation};printf"Keyword recommendation '%s' was found for campaign '%s'.\n",$recommendation->{resourceName},$recommendation->{campaign};my$keyword=$recommendation->{keywordRecommendation}{keyword};printf"\tKeyword = '%s'\n",$keyword->{text};printf"\tMatch type = '%s'\n",$keyword->{matchType};# Creates an ApplyRecommendationOperation that will apply this recommendation, and adds# it to the list of operations.push@$apply_recommendation_operations,build_recommendation_operation($recommendation);});
Any retrieved recommendation can be applied or dismissed.
Depending on the recommendation type, recommendations can change on a daily
basis or even multiple times a day. When that happens, a recommendation
object'sresource_namecan
become obsolete after the recommendation is retrieved.
It is good practice to take action on recommendations shortly after retrieval.
Recommendation types can have mandatory or optional parameters. Most
recommendations come with recommended values that are used by default.
Setting accounts forauto-applying recommendationsis not
supported for all recommendation types. However, you can implement similar
behavior for the recommendation types that are fully supported by the Google Ads API.
Refer to theDetectAndApplyRecommendationscode
exampleto learn more.
Use theapply_parametersunion field ofApplyRecommendationOperationto apply recommendations with
specific parameter values. Each suitable recommendation type has its own field.
Any recommendation type not listed in theapply_parametersfield does not use
these parameter values.
Code example
The following code demonstrates how to build theApplyRecommendationOperationand
how to override the recommended values if you want to replace them with your
own.
defbuild_recommendation_operation(client:GoogleAdsClient,recommendation:str)->ApplyRecommendationOperation:"""Creates a ApplyRecommendationOperation to apply the given recommendation.Args:client: an initialized GoogleAdsClient instance.recommendation: a resource name for the recommendation to be applied."""# If you have a recommendation ID instead of a resource name, you can create# a resource name like this:## googleads_service = client.get_service("GoogleAdsService")# resource_name = googleads_service.recommendation_path(# customer_id, recommendation.id# )operation:ApplyRecommendationOperation=client.get_type("ApplyRecommendationOperation")# Each recommendation type has optional parameters to override the# recommended values. Below is an example showing how to override a# recommended ad when a TextAdRecommendation is applied.## operation.text_ad.ad.resource_name = "INSERT_AD_RESOURCE_NAME"## For more details, see:# https://developers.google.com/google-ads/api/reference/rpc/latest/ApplyRecommendationOperation#apply_parametersoperation.resource_name=recommendationreturnoperation
defbuild_recommendation_operation(client,recommendation)# If you have a recommendation_id instead of the resource_name# you can create a resource name from it like this:# recommendation_resource =# client.path.recommendation(customer_id, recommendation_id)operations=client.operation.apply_recommendationoperations.resource_name=recommendation_resource# Each recommendation type has optional parameters to override the recommended# values. This is an example to override a recommended ad when a# TextAdRecommendation is applied.## text_ad_parameters = client.resource.text_ad_parameters do |tap|# tap.ad = client.resource.ad do |ad|# ad.id = "INSERT_AD_ID_AS_INTEGER_HERE"# end# end# operation.text_ad = text_ad_parameters## For more details, see:# https://developers.google.com/google-ads/api/reference/rpc/latest/ApplyRecommendationOperation#apply_parametersreturnoperationend
subbuild_recommendation_operation{my($recommendation)=@_;# If you have a recommendation ID instead of a resource name, you can create a resource# name like this:# my $recommendation_resource_name =# Google::Ads::GoogleAds::V21::Utils::ResourceNames::recommendation(# $customer_id, $recommendation_id);# Each recommendation type has optional parameters to override the recommended values.# Below is an example showing how to override a recommended ad when a TextAdRecommendation# is applied.# my $overriding_ad = Google::Ads::GoogleAds::V21::Resources::Ad->new({# id => "INSERT_AD_ID_AS_INTEGER_HERE"# });# my $text_ad_parameters =# Google::Ads::GoogleAds::V21::Services::RecommendationService::TextAdParameters# ->new({ad => $overriding_ad});# $apply_recommendation_operation->{textAd} = $text_ad_parameters;# Create an apply recommendation operation.my$apply_recommendation_operation=Google::Ads::GoogleAds::V21::Services::RecommendationService::ApplyRecommendationOperation->new({resourceName=>$recommendation->{resourceName}});return$apply_recommendation_operation;}
defapply_recommendations(client:GoogleAdsClient,customer_id:str,operations:List[ApplyRecommendationOperation],)->None:"""Applies a batch of recommendations.Args:client: an initialized GoogleAdsClient instance.customer_id: a client customer ID.operations: a list of ApplyRecommendationOperation messages."""# Issues a mutate request to apply the recommendations.recommendation_service=client.get_service("RecommendationService")response:ApplyRecommendationResult=(recommendation_service.apply_recommendation(customer_id=customer_id,operations=operations))forresultinresponse.results:print("Applied a recommendation with resource name: "f"'{result.resource_name}'.")
defapply_recommendations(client,customer_id,operations)# Issues a mutate request to apply the recommendation.recommendation_service=client.service.recommendationresponse=recommendation_service.apply_recommendation(customer_id:customer_id,operations:[operations],)response.results.eachdo|applied_recommendation|puts"Applied recommendation with resource name: '#{applied_recommendation.resource_name}'."endend
# Issue a mutate request to apply the recommendations.my$apply_recommendation_response=$api_client->RecommendationService()->apply({customerId=>$customer_id,operations=>$apply_recommendation_operations});foreachmy$result(@{$apply_recommendation_response->{results}}){printf"Applied recommendation with resource name: '%s'.\n",$result->{resourceName};}
To subscribe to a particular recommendation type, create aRecommendationSubscriptionobject,
set thetypefield to one of
the supported recommendationtypes, and set thestatusfield toENABLED.
Subscription-supported recommendation types
ENHANCED_CPC_OPT_IN
KEYWORD
KEYWORD_MATCH_TYPE
LOWER_TARGET_ROAS
MAXIMIZE_CLICKS_OPT_IN
OPTIMIZE_AD_ROTATION
RAISE_TARGET_CPA
RESPONSIVE_SEARCH_AD
RESPONSIVE_SEARCH_AD_IMPROVE_AD_STRENGTH
SEARCH_PARTNERS_OPT_IN
SEARCH_PLUS_OPT_IN
SET_TARGET_CPA
SET_TARGET_ROAS
TARGET_CPA_OPT_IN
TARGET_ROAS_OPT_IN
USE_BROAD_MATCH_KEYWORD
Retrieve subscriptions
To get information about an account's recommendation subscriptions, query therecommendation_subscriptionresource.
To view changes that were automatically applied, query thechange_eventresource, filtering thechange_event.client_typetoGOOGLE_ADS_RECOMMENDATIONS_SUBSCRIPTION.
GenerateRecommendationsaccepts as input a customer ID, an advertising channel
type which must be eitherSEARCHorPERFORMANCE_MAX,
a list of recommendation types to generate, and various data points dependent on
the specified types. It outputs a list ofRecommendationobjects based on the
data you provide. If there isn't sufficient data to generate a recommendation
for the requestedrecommendation_types,
or if the campaign is already in the recommended state, the result set won't
contain a recommendation for that type. Make sure your application handles the
case where no recommendations are returned for the requested recommendation
types.
The following table describes the recommendation types thatGenerateRecommendationssupports, and the fields you must provide to receive
recommendations for that type. As a best practice, send theGenerateRecommendationsrequestafterall information has been collected
related to the requested recommendation types. For additional details on
required and optional fields, including nested fields, consult thereference documentation.
For both Search and Performance Max campaigns, the following fields are required:
asset_group_info
final_url
bidding_strategy_type
For Search campaigns only, the following fields are also required:
country_code
language_code
positive_location_idornegative_location_id
ad_group_info.keywords
bidding_info. bidding_strategy_target_info. target_impression_share_infoif the bidding strategy is set toTARGET_IMPRESSION_SHARE
budget_info
For Performance Max campaigns, provide a value in themerchant_center_account_idfield to indicate toRecommendationsServiceto generate recommendations for retail, rather than standard, Performance Max campaigns.
KEYWORD
seed_info
ad_group_info
MAXIMIZE_CLICKS_OPT_IN
conversion_tracking_status
bidding_info
MAXIMIZE_CONVERSIONS_OPT_IN
conversion_tracking_status
bidding_info
MAXIMIZE_CONVERSION_VALUE_OPT_IN
conversion_tracking_status
bidding_info
SET_TARGET_CPA
conversion_tracking_status
bidding_info
SET_TARGET_ROAS
conversion_tracking_status
bidding_info
SITELINK_ASSET Note: The returnedSitelinkAssetRecommendationobject will contain empty lists. If theGenerateRecommendationsresponse contains aSitelinkAssetRecommendation, it can be
treated as a signal to add at least one sitelink asset to the campaign.
campaign_sitelink_count
TARGET_CPA_OPT_IN
conversion_tracking_status
bidding_info
TARGET_ROAS_OPT_IN
conversion_tracking_status
bidding_info
Example usage flow
Suppose your company is an advertising agency which provides a campaign
construction workflow to users, and you want to offer suggestions to users
during that flow. You can useGenerateRecommendationsRequestto generate recommendations on-demand, and incorporate those recommendations
into your campaign construction user interface.
The usage flow might look like the following:
A user comes to your application to create a Performance Max campaign.
The user provides some initial information as part of the campaign
construction flow. For example, they provide details to build a singleSitelinkAsset, and they selectTARGET_SPENDas theirSmart Biddingstrategy.
You send aGenerateRecommendationsRequestwhich sets the following fields:
campaign_sitelink_count:
set to1, which is the number of sitelink assets on the work-in-progress
campaign.
bidding_info:
set the nestedbidding_strategy_typefield toTARGET_SPEND.
conversion_tracking_status: set to theConversionTrackingStatusof this customer. For guidance on how to retrieve this field, visit theGetting startedguide for conversion management.
recommendation_types: set to[SITELINK_ASSET, MAXIMIZE_CLICKS_OPT_IN].
advertising_channel_type: set toPERFORMANCE_MAX.
customer_id: set to the ID of the customer creating the campaign.
You can take the recommendations in theGenerateRecommendationsResponse—
in this case, aSitelinkAssetRecommendationand aMaximizeClicksOptInRecommendation—and suggest them to the user by displaying them within your campaign
construction interface. If the user accepts a suggestion, you can then
incorporate it into the campaign creation request once the user completes
the campaign construction flow.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-03 UTC."],[[["\u003cp\u003eLeverage Google Ads recommendations to enhance campaign performance and efficiency.\u003c/p\u003e\n"],["\u003cp\u003eAccess and manage recommendations using the Google Ads API's \u003ccode\u003eRecommendationService\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eUnderstand the Optimization Score to gauge your account's potential and identify areas for improvement.\u003c/p\u003e\n"],["\u003cp\u003eExplore various recommendation types, including budget adjustments, keyword optimizations, and ad enhancements.\u003c/p\u003e\n"],["\u003cp\u003eUtilize provided code examples to programmatically retrieve and apply recommendations to your campaigns.\u003c/p\u003e\n"]]],[],null,[]]