User Tools

Site Tools


check_existing_campaign_locations

Differences

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

Link to this comparison view

check_existing_campaign_locations [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()
 +        .withCondition('​Name = "​[make_0055]{b}:​ yamaha"'​)
 +        .get();
 +  ​
 +  while (campaignIterator.hasNext()) {
 +    var campaign = campaignIterator.next();​
 +
 +// 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() + ', country code: ' +
 +          targetedLocation.getCountryCode() + ', bid modifier: ' +
 +          targetedLocation.getBidModifier());​
 +    }
 +  }
 +}
 +</​code>​
check_existing_campaign_locations.txt ยท Last modified: 2015/07/28 15:15 by vincenzo