Google Ads scripts allows you to manage bidding for your campaigns, ad groups and criteria. This guide explains this feature and its use. To set an Google Ads entity's bidding, you need to specify two parts:
- A bidding strategy
- The actual bid amount, if applicable
Google Ads scripts provides access to bidding for campaigns, ad groups,
and various criteria through their bidding()
method.
Bidding Strategy
A bidding strategy represents a bidding configuration that can be applied
to an Google Ads entity. A bidding strategy can either be anonymous or
flexible. You apply a bidding strategy to a campaign or ad group,
through the setStrategy()
method of its bidding()
property. The
following code snippet sets the bidding strategy of a campaign named
Test Campaign to TARGET_SPEND
.
var campaign = AdsApp.campaigns()
.withCondition("Name = 'Test Campaign'")
.get()
.next();
campaign.bidding().setStrategy("TARGET_SPEND");
Anonymous bid strategy
An anonymous bid strategy is applied directly to an entity. Google Ads scripts supports the following anonymous bid strategies:
Name | Description |
---|---|
MANUAL_CPC | Manual click based bidding where user pays per click. |
MANUAL_CPM | Manual impression based bidding where user pays per thousand impressions. This can only be used for Display Network only campaigns. |
TARGET_CPA | Target cost per acquisition based bidding that automatically optimizes conversions per dollar. |
TARGET_SPEND | Bidding strategy that automatically optimizes clicks per dollar. |
TARGET_ROAS | Bidding strategy that automatically maximizes revenue while averaging a specific target Return On Average Spend (ROAS). |
MAXIMIZE_CONVERSIONS | Bidding strategy that automatically maximizes number of conversions given a daily budget. |
MAXIMIZE_CONVERSION_VALUE | Bidding strategy that automatically maximizes the total conversion value of your campaign within a specified budget. |
TARGET_IMPRESSION_SHARE | Bidding strategy that automatically sets bids with the goal of showing your ad on the absolute top of the page, on the top of the page, or anywhere on the page of Google search results. |
Flexible bidding strategy
This strategy allows for defining a shared bidding configuration at the account level. You can then apply the shared bidding configuration to specific campaigns, ad groups, and keywords. You can learn more about this feature on our help center.
You can retrieve flexible bid strategies in your account as follows:
var biddingStrategy = AdsApp.biddingStrategies()
.withCondition("Name = 'My Shared Bidding Strategy'")
.get()
.next();
You can also access the campaigns, ad groups, or keywords that are using this bid strategy.
var adGroups = biddingStrategy.adGroups().get();
One benefit of using a flexible bidding strategy over an anonymous bidding strategy is that you can track the performance of Google Ads entities sharing the same bid strategy; for example, to get click stats for your account:
var clicks = biddingStrategy.getStatsFor("LAST_MONTH").getClicks();
If you need to change the bidding strategy for these entities, you can simply modify the associated shared bidding strategy instead of modifying the bidding strategy of individual Google Ads entities.