This is the legacy documentation for Google Ads scripts. Go to the current docs.

Platforms

Stay organized with collections Save and categorize content based on your preferences.

Set mobile bid modifier for a campaign

function setMobileBidModifier() {
  var campaignIterator = AdsApp.campaigns()
      .withCondition('Name = "INSERT_CAMPAIGN_NAME_HERE"')
      .get();
  if (campaignIterator.hasNext()) {
    var campaign = campaignIterator.next();
    // Retrieve the mobile target for campaign.
    var mobileTargetIterator = campaign.targeting().platforms().mobile().get();
    if (mobileTargetIterator.hasNext()) {
      mobileTarget = mobileTargetIterator.next();
      // Set the bid modifier for mobile platform.
      mobileTarget.setBidModifier(1.5);
    }
  }
}