Stay organized with collectionsSave and categorize content based on your preferences.
Cross-account bidding strategiesare effectivelySmart Biddingportfolio bidding strategies created in manager accounts. They can be used by
campaigns in any client account beneath the manager that owns the strategy.
Create and manage
Creating a new cross-account bidding strategy is almost identical to creating a
new portfolio bidding strategy, except you set thecustomer_idof the
API call to that of a manager account. Use a manager account's ID to create a
newBiddingStrategyresource, the same way
you would create a new portfolio strategy in a client account.
defcreate_bidding_strategy(client:GoogleAdsClient,manager_customer_id:str)->str:"""Creates a new cross-account bidding strategy in the manager account.The cross-account bidding strategy is of type TargetSpend (Maximize Clicks).Args:client: An initialized GoogleAdsClient instance.manager_customer_id: A manager customer ID.Returns:The ID of the newly created bidding strategy."""bidding_strategy_service:BiddingStrategyServiceClient=client.get_service("BiddingStrategyService")# Creates a portfolio bidding strategy.# Constructs an operation that will create a portfolio bidding strategy.bidding_strategy_operation:BiddingStrategyOperation=client.get_type("BiddingStrategyOperation")bidding_strategy:BiddingStrategy=bidding_strategy_operation.createbidding_strategy.name=f"Maximize Clicks #{uuid4()}"# Sets target_spend to an empty TargetSpend object without setting any# of its nested fields.bidding_strategy.target_spend=client.get_type("TargetSpend")# Sets the currency of the new bidding strategy. If not provided, the# bidding strategy uses the manager account's default currency.bidding_strategy.currency_code="USD"# Sends the operation in a mutate request.response:MutateBiddingStrategiesResponse=(bidding_strategy_service.mutate_bidding_strategies(customer_id=manager_customer_id,operations=[bidding_strategy_operation],))# Prints the resource name of the created cross-account bidding strategy.resource_name:str=response.results[0].resource_nameprint(f"Created cross-account bidding strategy: '{resource_name}'")returnresource_name
defcreate_bidding_strategy(client,manager_customer_id)# Constructs an operation that will create a portfolio bidding strategy.operation=client.operation.create_resource.bidding_strategydo|b|b.name="Maximize Clicks ##{(Time.new.to_f*1000).to_i}"b.target_spend=client.resource.target_spend# Sets the currency of the new bidding strategy. If not provided, the# bidding strategy uses the manager account's default currency.b.currency_code="USD"end# Sends the operation in a mutate request.response=client.service.bidding_strategy.mutate_bidding_strategies(customer_id:manager_customer_id,operations:[operation],)resource_name=response.results.first.resource_nameputs"Created cross-account bidding strategy: `#{resource_name}`"resource_nameend
# Creates a new TargetSpend (Maximize Clicks) cross-account bidding strategy in# the specified manager account.sub_create_bidding_strategy{my($api_client,$manager_customer_id)=@_;# Create a portfolio bidding strategy.my$portfolio_bidding_strategy=Google::Ads::GoogleAds::V21::Resources::BiddingStrategy->new({name=>"Maximize clicks #".uniqid(),targetSpend=>Google::Ads::GoogleAds::V21::Common::TargetSpend->new(),# Sets the currency of the new bidding strategy. If not provided, the# bidding strategy uses the manager account's default currency.currencyCode=>"USD"});# Send a create operation that will create the portfolio bidding strategy.my$mutate_bidding_strategies_response=$api_client->BiddingStrategyService()->mutate({customerId=>$manager_customer_id,operations=>[Google::Ads::GoogleAds::V21::Services::BiddingStrategyService::BiddingStrategyOperation->new({create=>$portfolio_bidding_strategy})]});my$resource_name=$mutate_bidding_strategies_response->{results}[0]{resourceName};printf"Created cross-account bidding strategy with resource name '%s'.\n",$resource_name;return$resource_name;}
Cross-account strategies in manager accounts support setting an optionalcurrency_code, allowing them to
share bidding strategies with client accounts in different currencies. The field
is optional, and if not set will default to the manager account's currency. Thecurrency_codefield is only mutable on cross-account bidding strategies.
# Constructs an operation that will create a portfolio bidding strategy.bidding_strategy_operation:BiddingStrategyOperation=client.get_type("BiddingStrategyOperation")bidding_strategy:BiddingStrategy=bidding_strategy_operation.createbidding_strategy.name=f"Maximize Clicks #{uuid4()}"# Sets target_spend to an empty TargetSpend object without setting any# of its nested fields.bidding_strategy.target_spend=client.get_type("TargetSpend")# Sets the currency of the new bidding strategy. If not provided, the# bidding strategy uses the manager account's default currency.bidding_strategy.currency_code="USD"
operation=client.operation.create_resource.bidding_strategydo|b|b.name="Maximize Clicks ##{(Time.new.to_f*1000).to_i}"b.target_spend=client.resource.target_spend# Sets the currency of the new bidding strategy. If not provided, the# bidding strategy uses the manager account's default currency.b.currency_code="USD"
my$portfolio_bidding_strategy=Google::Ads::GoogleAds::V21::Resources::BiddingStrategy->new({name=>"Maximize clicks #".uniqid(),targetSpend=>Google::Ads::GoogleAds::V21::Common::TargetSpend->new(),# Sets the currency of the new bidding strategy. If not provided, the# bidding strategy uses the manager account's default currency.currencyCode=>"USD"});
Some fields of a bidding strategy can be updated, depending on itstype. Manager accounts that own a bidding strategy (or their
managers) can update the fields of a coss-account bidding strategy similarly
to any otherportfolio strategy.
For example, to change the maximum bid limit for theTargetSpendstrategy created in the previous example,
set itscpc_bid_ceiling_microsfield to a new value.
Remove unused strategies
To remove a cross-account bidding strategy, it must not be in use by any
campaigns. Attempting to remove a strategy that is still in use will result in aCANNOT_REMOVE_ASSOCIATED_STRATEGYerror. You must firstremove the strategyfrom any associated campaigns.
Read attributes
TheBiddingStrategyresource is used to create, update, and get properties of
bidding strategieswithin a single account. As mentioned in the previous
section, when that account is a manager, then mutating and reading from aBiddingStrategyresource manages cross-account bidding strategies.
Thus, when you are making API calls with a manager account, you can list and
read its list of owned cross-account bidding strategies by querying theBiddingStrategyresource:
deflist_manager_owned_bidding_strategies(client:GoogleAdsClient,manager_customer_id:str)->None:"""List all cross-account bidding strategies in the manager account.Args:client: An initialized GoogleAdsClient instance.manager_customer_id: A manager customer ID."""googleads_service:GoogleAdsServiceClient=client.get_service("GoogleAdsService")query="""SELECTbidding_strategy.id,bidding_strategy.name,bidding_strategy.type,bidding_strategy.currency_codeFROM bidding_strategy"""# Creates and issues a search Google Ads stream request that will retrieve# all bidding strategies.stream:Iterator[SearchGoogleAdsStreamResponse]=(googleads_service.search_stream(customer_id=manager_customer_id,query=query))# Iterates through and prints all of the results in the stream response.print("Cross-account bid strategies in manager account: "f"{manager_customer_id}")response:SearchGoogleAdsStreamResponseforresponseinstream:row:GoogleAdsRowforrowinresponse.results:bs:BiddingStrategy=row.bidding_strategyprint(f"\tID:{bs.id}\n"f"\tName:{bs.name}\n"f"\tStrategy type:{bs.type_.name}\n"f"\tCurrency:{bs.currency_code}\n\n")
# Lists all cross-account bidding strategies in a specified manager account.sub_list_manager_owned_bidding_strategies{my($api_client,$manager_customer_id)=@_;# Create a GAQL query that will retrieve all cross-account bidding# strategies.my$query="SELECTbidding_strategy.id,bidding_strategy.name,bidding_strategy.type,bidding_strategy.currency_codeFROM bidding_strategy";# Issue a streaming search request, then iterate through and print the# results.my$search_stream_handler=Google::Ads::GoogleAds::Utils::SearchStreamHandler->new({service=>$api_client->GoogleAdsService(),request=>Google::Ads::GoogleAds::V21::Services::GoogleAdsService::SearchGoogleAdsStreamRequest->new({customerId=>$manager_customer_id,query=>$query})});printf"Cross-account bid strategies in manager account $manager_customer_id:\n";$search_stream_handler->process_contents(sub{my$google_ads_row=shift;my$bidding_strategy=$google_ads_row->{biddingStrategy};printf"\tID: $bidding_strategy->{id}\n"."\tName: $bidding_strategy->{name}\n"."\tStrategy type: $bidding_strategy->{type}\n"."\tCurrency: $bidding_strategy->{currencyCode}\n\n";});}
When working withclient accountsthat use cross-account bidding strategies,
theAccessibleBiddingStrategyresource is used to provide a read-only view of all bidding strategies
accessible to the current customer. This includes both portfolio strategies
owned by the customer and cross-account bidding strategies shared with the
customer.
Get all accessible bidding strategies
To retrieve all bidding strategies accessible by the current customer, query theaccessible_bidding_strategyresource
directly. The results will by default include both portfolio strategies in the
current account and cross-account bidding strategies shared by a manager.
deflist_customer_accessible_bidding_strategies(client:GoogleAdsClient,customer_id:str)->None:"""Lists all bidding strategies available to the client account.This includes both portfolio bidding strategies owned by account andcross-account bidding strategies shared by any of its managers.Args:client: An initialized GoogleAdsClient instance.customer_id: A client customer ID."""googleads_service:GoogleAdsServiceClient=client.get_service("GoogleAdsService")query="""SELECTaccessible_bidding_strategy.id,accessible_bidding_strategy.name,accessible_bidding_strategy.type,accessible_bidding_strategy.owner_customer_id,accessible_bidding_strategy.owner_descriptive_nameFROM accessible_bidding_strategy"""# Uncomment the following WHERE clause to filter results to *only*# cross-account bidding strategies shared with the current customer by a# manager (and not also include the current customer's portfolio# bidding strategies).## query += f"WHERE accessible_bidding_strategy.owner_customer_id != {customer_id}"# Creates and issues a search Google Ads stream request that will retrieve# all bidding strategies.stream:Iterator[SearchGoogleAdsStreamResponse]=(googleads_service.search_stream(customer_id=customer_id,query=query))# Iterates through and prints all of the results in the stream response.print(f"All bid strategies accessible by account '{customer_id}'\n")response:SearchGoogleAdsStreamResponseforresponseinstream:row:GoogleAdsRowforrowinresponse.results:bs:AccessibleBiddingStrategy=row.accessible_bidding_strategyprint(f"\tID:{bs.id}\n"f"\tName:{bs.name}\n"f"\tStrategy type:{bs.type_.name}\n"f"\tOwner customer ID:{bs.owner_customer_id}\n"f"\tOwner description:{bs.owner_descriptive_name}\n\n")
deflist_customer_accessible_bidding_strategies(client,customer_id)query=<<~QUERYSELECTaccessible_bidding_strategy.id,accessible_bidding_strategy.name,accessible_bidding_strategy.type,accessible_bidding_strategy.owner_customer_id,accessible_bidding_strategy.owner_descriptive_nameFROMaccessible_bidding_strategyQUERY# Add the following WHERE clause to filter results to *only*# cross-account bidding strategies shared with the current customer by a# manager (and not also include the current customer's portfolio bidding# strategies).# query += <<~QUERY# WHERE accessible_bidding_strategy.owner_customer_id != #{customer_id}# QUERYresponses=client.service.google_ads.search_stream(customer_id:customer_id,query:query,)puts"All bid strategies accessible by account#{customer_id}:"responses.eachdo|response|response.results.eachdo|row|b=row.accessible_bidding_strategyputs"ID:#{b.id}"puts"Name:#{b.name}"puts"Strategy type:#{b.type}"puts"Owner customer ID:#{b.owner_customer_id}"puts"Owner description:#{b.owner_descriptive_name}"putsendendend
# Lists all bidding strategies available to specified client customer account.# This includes both portfolio bidding strategies owned by the client customer# account and cross-account bidding strategies shared by any of its managers.sub_list_customer_accessible_bidding_strategies{my($api_client,$customer_id)=@_;# Create a GAQL query that will retrieve all accessible bidding strategies.my$query="SELECTaccessible_bidding_strategy.resource_name,accessible_bidding_strategy.id,accessible_bidding_strategy.name,accessible_bidding_strategy.type,accessible_bidding_strategy.owner_customer_id,accessible_bidding_strategy.owner_descriptive_nameFROM accessible_bidding_strategy";# Uncomment the following WHERE clause addition to the query to filter results# to *only* cross-account bidding strategies shared with the current customer# by a manager (and not also include the current customer's portfolio bidding# strategies).# $query .=# " WHERE accessible_bidding_strategy.owner_customer_id != $customer_id";# Issue a streaming search request, then iterate through and print the# results.my$search_stream_handler=Google::Ads::GoogleAds::Utils::SearchStreamHandler->new({service=>$api_client->GoogleAdsService(),request=>Google::Ads::GoogleAds::V21::Services::GoogleAdsService::SearchGoogleAdsStreamRequest->new({customerId=>$customer_id,query=>$query})});printf"All bid strategies accessible by account $customer_id:\n";$search_stream_handler->process_contents(sub{my$google_ads_row=shift;my$bidding_strategy=$google_ads_row->{accessibleBiddingStrategy};printf"\tID: $bidding_strategy->{id}\n"."\tName: $bidding_strategy->{name}\n"."\tStrategy type: $bidding_strategy->{type}\n"."\tOwner customer ID: $bidding_strategy->{ownerCustomerId}\n"."\tOwner description: $bidding_strategy->{ownerDescriptiveName}\n\n";});}
You can also fetch fields ofbidding_strategyandaccessible_bidding_strategywhen you query for campaigns. By usingcampaignin your query's FROM clause, the matching campaigns will implicitly join any
associatedbidding_strategyandaccessible_bidding_strategyresources.
For example, the following query will fetch all active campaigns and fields of
their associatedbidding_strategyandaccessible_bidding_strategyresources.
Similar tostandard portfolio bidding strategies, you
attach a cross-account bidding strategy to a campaign by setting itsbidding_strategyto the resource
name of a cross-account bidding strategy. Only managers that own a cross-account
bidding strategy (or managers of those managers) can attach them to campaigns.
So API calls that attach cross-account bidding strategies to a campaign must use
alogin-customer-idof a manager that has the appropriate access to the bidding strategy.
defattach_cross_account_bidding_strategy_to_campaign(client:GoogleAdsClient,customer_id:str,campaign_id:str,bidding_strategy_resource_name:str,)->None:"""Attaches the cross-account bidding strategy to the given campaign.Args:client: An initialized GoogleAdsClient instance.customer_id: A client customer ID.campaign_id: The ID of an existing campaign in the client customer'saccount.bidding_strategy_resource_name: The ID of a bidding strategy"""campaign_service:CampaignServiceClient=client.get_service("CampaignService")campaign_operation:CampaignOperation=client.get_type("CampaignOperation")campaign:Campaign=campaign_operation.updatecampaign.resource_name=campaign_service.campaign_path(customer_id,campaign_id)campaign.bidding_strategy=bidding_strategy_resource_nameclient.copy_from(campaign_operation.update_mask,protobuf_helpers.field_mask(None,campaign._pb),)# Sends the operation in a mutate request.response:MutateCampaignsResponse=campaign_service.mutate_campaigns(customer_id=customer_id,operations=[campaign_operation])# Prints the resource name of the updated campaign.print("Updated campaign with resource name: "f"'{response.results[0].resource_name}'")
defattach_cross_account_bidding_strategy_to_campaign(client,customer_id,campaign_id,bidding_strategy_resource_name)operation=client.operation.update_resource.campaign(client.path.campaign(customer_id,campaign_id))do|c|c.bidding_strategy=bidding_strategy_resource_nameend# Sends the operation in a mutate request.response=client.service.campaign.mutate_campaigns(customer_id:customer_id,operations:[operation],)puts"Updated campaign with resource name: "\"`#{response.results.first.resource_name}`"end
# Attaches a specified cross-account bidding strategy to a campaign owned by a# specified client customer account.sub_attach_cross_account_bidding_strategy_to_campaign{my($api_client,$customer_id,$campaign_id,$bidding_strategy_resource_name)=@_;my$campaign=Google::Ads::GoogleAds::V21::Resources::Campaign->new({resourceName=>Google::Ads::GoogleAds::V21::Utils::ResourceNames::campaign($customer_id,$campaign_id),biddingStrategy=>$bidding_strategy_resource_name});my$campaign_operation=Google::Ads::GoogleAds::V21::Services::CampaignService::CampaignOperation->new({update=>$campaign,updateMask=>all_set_fields_of($campaign)});my$campaigns_response=$api_client->CampaignService()->mutate({customerId=>$customer_id,operations=>[$campaign_operation]});printf"Updated campaign with resource name '%s'.\n",$campaigns_response->{results}[0]{resourceName};}
If a client account is unlinked from its manager, any cross-account bidding
strategies shared by that manager will no longer be accessible. Any of the
client's campaigns set to use such a bidding strategy will stop serving
and must be updated to use a different bidding strategy.
[[["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\u003eCross-account bidding strategies are Smart Bidding portfolio strategies housed in manager accounts and shared with client accounts.\u003c/p\u003e\n"],["\u003cp\u003eThese strategies can be created, updated, and removed using the Google Ads API, with code examples provided in various programming languages.\u003c/p\u003e\n"],["\u003cp\u003eYou can attach cross-account strategies to campaigns and view them from both manager and client accounts.\u003c/p\u003e\n"],["\u003cp\u003eWhen a client account is unlinked from its manager, any associated cross-account bidding strategies are removed and campaigns using them will stop serving.\u003c/p\u003e\n"],["\u003cp\u003eEnsure the strategy's currency matches the campaign's currency, as it cannot be changed once created.\u003c/p\u003e\n"]]],[],null,[]]