AdWords Structure or Migrate Keywords and Ads using AdWords Scripts?

29 views
Skip to first unread message

Cameron Roe

unread,
Dec 5, 2017, 4:06:14 AM12/5/17
to AdWords Scripts Forum
I have a lot of Ad Groups defined under different City Search Campaigns.
  • San Francisco Market
    • Price-based "SOMA"
    • Price-based "Dogpatch"
  • Manhattan Market
    • Price-based "Manhattan"
    • Price-based "NYC"
  • Peninsula Market
    • Price-based "Mountain View"
    • Price-based "Stanford"
Each Ad group has specific Headlines that include the name variant for the city. The Price-based stands for the pricing copy that is included in this specific Ad group. I plan to have other Ad groups that aren't specifically testing price.

My goal is to migrate these different city name variants into a single "Price-based" Ad group under each market. I have a few questions about this:

  1. Is this even a best practice? How should I go about setting up various Ad groups inside of different location markets so that I can define specific keywords to go to specific Ads that show variant terms related to keyword searches. (Ex. nyc housing => Headline with NYC, or manhattan housing => Headline with Manhattan)
  2. If this structure is okay to merge into a single Ad group and still work, how would I automate the scripting of migrating Keywords, Ads to different Ad groups?

In general, how can I write scripts to move around Keywords, Ads.. it didn't seem possible by looking at the docs. Any ideas?





Anthony Madrigal

unread,
Dec 5, 2017, 3:18:04 PM12/5/17
to AdWords Scripts Forum
Hi,

As far as whether or not setting your account with this structure is a best practice, I would recommend reaching out to the AdWords Community Forum as they will be better suited to answer you.

While there is no way to move keywords or ads to different ad groups, you can use both a KeywordSelector and AdSelector to grab its fields so that you pass it off to the appropriate ad group to use newKeywordBuilder and newAd builders.

Regards,
Anthony
AdWords Scripts Team

Cameron Roe

unread,
Dec 5, 2017, 5:44:16 PM12/5/17
to AdWords Scripts Forum
Thanks. The only problem is that these are actually draft experiments. Is it still possible to grab their Ad groups via the scripts?

Anthony Madrigal

unread,
Dec 6, 2017, 9:26:00 AM12/6/17
to AdWords Scripts Forum
Hi Cameron,

There won't be an issue. You should be able to get the ad groups of experiment campaigns.

If you are facing any trouble, please let me know.

Regards,
Anthony
AdWords Scripts Team

Cameron Roe

unread,
Dec 6, 2017, 3:01:27 PM12/6/17
to AdWords Scripts Forum
Hi Anthony,

I am facing some trouble. I'm not sure how to write this in the scripts.. are you saying to loop over the Ad groups in the experiments and add the Keywords/Ads from the existing ad groups?

Anthony Madrigal

unread,
Dec 6, 2017, 4:51:11 PM12/6/17
to AdWords Scripts Forum
Hi Cameron,

This script should help you get started. The script will get the keywords from a specified ad group and add them to the specified experiment ad group:
function main(){
 
var oldAdGroup = AdWordsApp.adGroups()
 
.withCondition('Name = "Some Ad Group"')
 
.get().next();
 
var experimentAdGroup = AdWordsApp.adGroups()
 
.withCondition('Name = "My experiment"')
 
.get().next();
 
var ekws = oldAdGroup.keywords().get();
 
while(ekws.hasNext()){
   
var kw = ekws.next();
    experimentAdGroup
.newKeywordBuilder().withText(kw.getText()).build();
 
}  
}


Regards,
Anthony
AdWords Scripts Team

Reply all
Reply to author
Forward
0 new messages