AdWords Proximity Script not Making Targeting Changes

77 views
Skip to first unread message

Katie Crostic

unread,
Jun 23, 2014, 3:23:22 PM6/23/14
to adwords...@googlegroups.com
I have been using the proximity targeting script as provided in the examples by Google Developers, and although the script runs without error, no logs or changes are made. I initially started by customizing it to our needs, which would obviously not be to target 10 KM around the Google office, but when the script ran repeatedly with no results, I decided just to try it with minimal changes, to see if my changes were causing a problem. Unfortunately, when the script runs as provided from Google, it doesn't appear to do the job. 

Can you see if I am doing something wrong here?

Thanks!!

Katie

Here is the code I am using:
function main() {
  function targetCampaignByProximity() {
  var campaignIterator = AdWordsApp.campaigns()
        .withCondition('Name = "Banfield - [SA] [5028] - Edina - Edina,MN - NB - (S) - [1]"')
        .get();
  if (campaignIterator.hasNext()) {
    var campaign = campaignIterator.next();
    // Add a proximity target of 20 kilometers around Google New York office.
    // To obtain coordinates of a given point on Google Maps,
    campaign.addProximity(40.741144, -74.002086, 20, 'KILOMETERS');

    // You could also add proximity by an address. However, we don't validate
    // if the address you put matches the given latitude and longitude. It has
    // no functionality except to change what shows up in the Campaign
    // Management interface.

    // Add a proximity target of 10 kilometers around Google Mountain View
    // office.
    campaign.addProximity({
      latitude: 37.423021,
      longitude: -122.083739,
      radius: 10,
      radiusUnits: 'KILOMETERS',
      bidModifier: 0.75,
      address: {
        streetAddress: '1600 Amphitheatre Parkway',
        cityName: 'Mountain View',
        provinceName: 'California',
        provinceCode: 'CA',
        postalCode: '94043',
        countryCode: 'US'
      }
    });
  }
}
}

Anash Oommen

unread,
Jun 25, 2014, 11:07:20 AM6/25/14
to adwords...@googlegroups.com
Hi Katie,

You have pasted the code within the main function, you need to paste it outside and call the method from main() instead. Also, keep only one of the addProximity calls, depending on whether you want to use an address, or Google maps co-ordinates directly.

function main() {
  targetCampaignByProximity
();


Cheers,
Anash P. Oommen,
AdWords Scripts Team

Katie Crostic

unread,
Jun 25, 2014, 4:09:30 PM6/25/14
to adwords...@googlegroups.com
Thank you so much!! 

This small adjustment worked perfectly, and is even enabling me to target 100s of radii in one swoop. I didn't think I would get a response so fast, and we thought we were going to have to consult a developer. This is a lifesaver! Our client is very very pleased! :)

Katie
Reply all
Reply to author
Forward
0 new messages