Hide

Ad Group Level Bid Modifiers

Ad group level bid adjustments give you more control over your bids in AdWords campaigns, providing the option to individually override campaign-level bids for certain criteria. Within the AdWords API, ad group level adjustments are accessible via AdGroupBidModifierService.

Note: Currently, only HighEndMobile criterion (ID=30001) bids can be adjusted at the ad group level.

This guide contains examples in Java, refer to the client libraries page for examples in other languages.

Retrieving bid adjustments

In order to retrieve existing bid adjustments, use the AdGroupBidModifierService get request. Similarly to other services, the get method accepts a generic selector allowing you to select response fields and filter the results set.

Note: AdGroupBidModifierService always returns a full list of campaigns, ad groups and criteria combinations matching the request predicates. Include predicates in the selector to retrieve bid modifiers specific to a particular campaign or ad group.

The code below will retrieve the first 10 existing bid modifiers across all your campaigns:

// Get the AdGroupBidModifierService.
AdGroupBidModifierServiceInterface bidModifierService =
    adWordsServices.get(session, AdGroupBidModifierServiceInterface.class);

// Create selector.
Selector selector = new Selector();
selector.setFields(
    new String[] {"CampaignId", "AdGroupId", "Id", "BidModifier"});
selector.setPaging(new Paging(0, 10));

// Make a 'get' request.
AdGroupBidModifierPage page = bidModifierService.get(selector);

// Display bid modifiers.
if (page.getEntries() != null) {
  for (AdGroupBidModifier modifier : page.getEntries()) {
    String value = (modifier.getBidModifier() == null) ?
        "unset" : String.valueOf(modifier.getBidModifier())
    System.out.println("Campaign ID " + modifier.getCampaignId()
        + ", AdGroup ID " + modifier.getAdGroupId()
        + ", Criterion ID " + modifier.getCriterion().getId()
        + " has ad group level modifier: " + value);
  }
} else {
  System.out.println("No bid modifiers were found.");
}

Adding, updating and removing bid adjustments

Use AdGroupBidModifierService mutate to add or amend a bid adjustment. To add a new bid modifier for a combination of campaign, ad group and criterion IDs, use the ADD operator; to update an existing bid override to a new value, use the SET operator. No value will be returned if no ad group level override was set. To remove a bid modifier override, use the REMOVE operator.

Note: The valid range for bidModifier at the ad group level is from 0.1 to 4.0. A value of 0 is also allowed and is used to opt out of mobile.

This example demonstrates how to add a new ad group level mobile bid adjustment:

// Get the AdGroupBidModifierService.
AdGroupBidModifierServiceInterface bidModifierService =
    adWordsServices.get(session, AdGroupBidModifierServiceInterface.class);

// Set values for ad group, criterion IDs and bid modifier.
long adGroupId = Long.parseLong("INSERT_AD_GROUP_ID_HERE");
// Mobile criterion ID.
long criterionId = 30001;
double bidModifier = 1.1;

// Create criterion and bid modifier locally.
Criterion criterion = new Platform();
criterion.setId(criterionId);

AdGroupBidModifier modifier = new AdGroupBidModifier();
modifier.setAdGroupId(adGroupId);
modifier.setCriterion(criterion);
modifier.setBidModifier(bidModifier);

// Create operations.
AdGroupBidModifierOperation operation = new AdGroupBidModifierOperation();
operation.setOperand(campaign);
operation.setOperator(Operator.ADD);
AdGroupBidModifierOperation[] operations =
    new AdGroupBidModifierOperation[] {operation};

// Execute mutate request.
AdGroupBidModifierReturnValue result = bidModifierService.mutate(operations);

// Display result.
for (AdGroupBidModifier modifier : result.getValue()) {
  String value = (modifier.getBidModifier() == null) ?
      "unset" : String.valueOf(modifier.getBidModifier())
  System.out.println("Campaign ID " + modifier.getCampaignId() + ", AdGroup ID "
      + modifier.getAdGroupId() + ", Criterion ID " + modifier.getCriterion().getId()
      + " was updated with ad group level modifier: " + value);
}

Send feedback about...

AdWords API