Sets the target roas if the applied bidding strategy allows it.
argsBuilder()
Returns a builder that can be used to build up arguments for a bidding strategy. Use with
setStrategy to specify arguments needed when applying a bidding strategy.
Clears the cpc bid ceiling if the applied bidding strategy allows it.
Returns nothing.
getCpcBidCeiling()
Returns the cpc bid ceiling (in the account's currency) if the applied bidding strategy has
one. Otherwise returns null.
Return values:
Type
Description
Double
The cpc bid ceiling.
getCpcBidFloor()
Returns the cpc bid floor (in the account's currency) if the applied bidding strategy has one.
Otherwise returns null.
Return values:
Type
Description
Double
The cpc bid floor.
getEnhancedCpcEnabled()
Returns true if the applied bidding strategy has enhanced cpc enabled. Returns false if the applied bidding strategy has enhanced cpc disabled. Returns null if the
applied bidding strategy type does not make use of enhanced cpc.
Return values:
Type
Description
Boolean
A boolean indicating whether enhanced cpc is enabled.
getLocationFraction()
The desired fraction of ads to be shown in the targeted location. Specified as a percentage
from 0-100.
Returns null if the applied bidding strategy does not support location fractions.
Return values:
Type
Description
Double
The desired percentage of ads to be shown in the targeted location.
getLocationType()
The targeted location for ads to show. Returns null if the applied bidding strategy
does not support location types.
Return values:
Type
Description
String
The targeted location for ads to show.
getStrategy()
Returns the flexible bidding strategy of the campaign. If this
campaign has an anonymous bidding strategy, or no bidding strategy, null is returned.
The flexible bidding strategy associated with this campaign.
getStrategySource()
Returns the bidding strategy source of this campaign. Always returns
'CAMPAIGN'.
Return values:
Type
Description
String
The bidding strategy source of this campaign.
getStrategyType()
Returns the bidding strategy type of this campaign. This may either be an
anonymous bidding strategy, or the type of a flexible bidding strategy.
Return values:
Type
Description
String
The strategy type of this campaign.
getTargetCpa()
The target cpa (in the account's currency) of the applied bidding strategy. Returns null if the applied bidding strategy does not have a target cpa.
Return values:
Type
Description
Double
The target cpa.
getTargetRoas()
The target roas of the applied bidding strategy. This is the desired revenue (based on
conversion data) per unit of spend represented as a percentage. For example, if your goal is to
get an average of $5 in sales for each $1 you spend on ads, your target roas would be 500%.
Returns null if the applied bidding strategy does not have a target roas.
Return values:
Type
Description
Double
The target roas.
setCpcBidCeiling(cpc)
Sets the cpc bid ceiling (in the account's currency) if the applied bidding strategy allows it.
If the applied bidding strategy does not use a cpc bid ceiling this will throw an error.
Returns nothing.
Arguments:
Name
Type
Description
cpc
double
The cpc bid ceiling.
setEnhancedCpcEnabled(enhancedCpcEnabled)
Enables or disables enhanced cpc for the applied bidding strategy. Throws an error if enhanced
cpc is not relevant to the applied bidding strategy.
Returns nothing.
Arguments:
Name
Type
Description
enhancedCpcEnabled
boolean
A boolean indicating whether enhanced cpc is enabled.
setLocationFraction(locationFraction)
Sets the desired percentage of ads to be shown in the targeted location. Specified as a
percentage from 0-100.
Throws an error if the applied bidding strategy does not support location fractions.
Returns nothing.
Arguments:
Name
Type
Description
locationFraction
double
The location fraction.
setLocationType(locationType)
Sets the targeted location for ads. Accepted values are: ANYWHERE_ON_PAGE, TOP_OF_PAGE,
ABSOLUTE_TOP_OF_PAGE
Throws an error if the applied bidding strategy does not support location types.
Returns nothing.
Arguments:
Name
Type
Description
locationType
String
The location type.
setStrategy(biddingStrategy)
Sets the bidding strategy of this campaign to the specified standard bidding
strategy.
The Google Ads API bidding
strategy guide contains a list of all valid standard bidding strategies. Note that
specifying portfolio strategies will result in error.
Returns nothing.
Arguments:
Name
Type
Description
biddingStrategy
String
A string representation of a standard bidding strategy.
setStrategy(biddingStrategy)
Sets the bidding strategy of this campaign to the provided portfolio bidding
strategy.
Note that AdsApp does not support creating bidding strategies, so if the desired portfolio
bidding strategy does not already exist in your account, you should first create the bidding
strategy through the Google Ads user interface, and then access that bidding strategy using
BiddingStrategySelector or BiddingStrategyIterator.
Sets the bidding strategy of this campaign to the specified standard bidding
strategy.
The Google Ads API bidding
strategy guide contains a list of all valid standard bidding strategies. Note that
specifying portfolio strategies will result in error.
Returns nothing.
Arguments:
Name
Type
Description
biddingStrategy
String
A string representation of a standard bidding strategy.
Sets the bidding strategy of this campaign to the specified standard bidding
strategy.
The Google Ads API bidding
strategy guide contains a list of all valid standard bidding strategies. Note that
specifying portfolio strategies will result in error.
Some bidding strategies support or require specification of additional fields. The exact set
of required and optional fields differs for each bidding strategy type.
All fields are case-sensitive, and so are all values of enumerated fields (such as
locationType). The set of required and optional fields differs for each strategy type.
Field
Type
Description
cpcBidCeiling
Double
The maximum cpc bid to use. Specified in the account's currency.
enhancedCpcEnabled
boolean
Whether bids are to be enhanced based on conversion optimizer data. If unspecified,
defaults to false.
locationFraction
Double
The desired fraction of ads to be shown in the targeted location. Specified as a
percentage from 0 to 100 (inclusive).
locationType
Enum
The location on the search results page to target (e.g. 'TOP_OF_PAGE'). For a full list
of possible locations see the
Google Ads API documentation.
targetRoas
Double
The target return on ad spend. Specified in the account's currency. Must be between
0.01 and 1000 (inclusive).
Returns nothing.
Arguments:
Name
Type
Description
biddingStrategy
String
A string representation of a standard bidding strategy.
Sets the target roas if the applied bidding strategy allows it. This is the desired revenue
(based on conversion data) per unit of spend. Value must be a number (representing percentage)
between 1.0 and 100000.0, inclusive. If the applied bidding strategy does not use a target roas
this will throw an error.