Adwords Scripts for location bid modifier

446 views
Skip to first unread message

Yen-Hsiu Shen

unread,
Nov 20, 2013, 8:33:14 AM11/20/13
to adwords...@googlegroups.com
Hi there,

I was wondering if anyone has experience of using scripts to adjust the bidding based on your website location data?

Basically, we have a eCommerce website with delivery services in UK.

I want to use scripts to control the location bidding if we know we don't have the delivery slot for specific area.

Thanks
Yen   

Anash Oommen

unread,
Nov 23, 2013, 1:47:13 PM11/23/13
to adwords...@googlegroups.com
Hi Yen,

You need to look at TargetedLocation class, which allows you to set geo level bid modifiers. See https://developers.google.com/adwords/scripts/docs/reference/adwordsapp_targetedlocation for details. I realize we don't have a solution or guide for this topic, I'll work on adding one.

The code would be something like

 var campaign = AdWordsApp.campaigns().withCondition("CampaignName = 'MY_CAMPAIGN_NAME_HERE').get().next();
 var locations = campaign.targeting().targetedLocations().get();
 while (locations.hasNext()) {
   var location = locations.next();
   location.setBidModifier(NEW_BID_MODIFIER_HERE);
 }



Cheers,
Anash P. Oommen,
AdWords Scripts Team

Anash Oommen

unread,
Nov 23, 2013, 1:48:30 PM11/23/13
to adwords...@googlegroups.com
Added a missing double quote. Fixed snippet below:


 var campaign = AdWordsApp.campaigns().withCondition("CampaignName = 'MY_CAMPAIGN_NAME_HERE'").get().next();
 
var locations = campaign.targeting().targetedLocations().get();
 
while (locations.hasNext()) {
   
var location = locations.next();
   location
.setBidModifier(NEW_BID_MODIFIER_HERE);
 
}

Cheers,
Anash

Oleg Amirdzhanov

unread,
May 2, 2014, 5:06:43 PM5/2/14
to adwords...@googlegroups.com
Hi Anash...  

What if what if I'm running a large number of national campaigns targeted to United States, but need to apply bid modifier for all keywords in all those campaigns but for a couple of specific DMAs only (without duplicating or building out separate campaigns and just targeting them to those specific DMAs)...  How do I set additional DMA targets to already existing national campaigns and applying bid modifiers only to those DMAs?  Is there a mechanism to add location in a similar way as pull it -- s.a. something like campaign.targeting().targetLocation().set() as oppose to .get() ??-- I would really appreciate any insight on this one...  

_oleg

Anash Oommen

unread,
May 5, 2014, 2:37:47 PM5/5/14
to adwords...@googlegroups.com
Hi Oleg,

I believe you are looking for campaign.addLocation to add a new DMA target, then targetedLocation.setBidModifier to modify the bid modifier for an existing location.

Cheers,
Anash P. Oommen,
AdWords Scripts Team.

mark pitchford

unread,
Nov 20, 2015, 6:21:40 AM11/20/15
to AdWords Scripts Forum
Hi,

Realize this is quite old now but hoping someone could help, I'm trying to do the same as below but I have the list of the campaigns, locations and bid modifier in a google sheet, I'm new to scripts so struggling to figure it out. I'm looking to get the list of campaign names from my google sheet, list of Any help would be greatly appreciated! There is an example sheet here https://docs.google.com/spreadsheets/d/19Cg4oAWU0SAVyLRleg5IXAJ4hAYAFncNg-IIpvk-c3g/edit#gid=0

Thanks,

Mark
Reply all
Reply to author
Forward
0 new messages