User Tools

Site Tools


update_campaign_location

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

update_campaign_location [2015/07/28 15:15] (current)
vincenzo created
Line 1: Line 1:
 +<code javascript>​
 +// Update Location ​
 +function main() {
 + 
 +// Apply changes to all campaigns
  
 +//  var campaignIterator = AdWordsApp.campaigns()
 +//        .get();
 +
 +  var campaignIterator = AdWordsApp.campaigns()
 +      .withCondition('​Name = "​[gnrc_0001]{b}:​ mobil (cars)"'​)
 +      .get();
 +
 +  while (campaignIterator.hasNext()) {
 +    var campaign = campaignIterator.next();​
 +
 +// Change location and bid adjuster here
 +    campaign.addLocation(2840,​ 1.15);
 +
 +// Here you check that targeting already existing for the campaigns
 +
 +    var locationIterator = campaign.targeting().targetedLocations().get();​
 +
 +    while (locationIterator.hasNext()) {
 +      var targetedLocation = locationIterator.next();​
 +      Logger.log('​Location name: ' +
 +          targetedLocation.getName() + ', bid modifier: ' +
 +          targetedLocation.getBidModifier());​
 +    }
 +  }
 +}
 +</​code>​
update_campaign_location.txt ยท Last modified: 2015/07/28 15:15 by vincenzo