AdWords
6.9K members online now
6.9K members online now
Dive into advanced features like Remarketing, Flexible Bid Strategies, AdWords Editor, and AdWords Scripts
Guide Me
star_border
Reply

Syncing Shared Library Negative Keyword Lista accross (MCC) accounts

Follower ✭ ✭ ☆
# 1
Follower ✭ ✭ ☆

Hey there,

I was just wondering if there is a way to sync my Shared Library Negative Keyword Lists (all have the same name) accross all accounts linked to the same MCC. I takes up lots of time to keep the lists in sync manually. If anyone had an ideas how to semi-automate this I would also be happy to hear those! 

 

I am also using Supermetrics for Google Drive and haven't found a way to do it through them. Even scheduling the negative keyword lists as monthly email-reports doesn't help much since there are not attached but have to be downloaded manually. 

 

Looking forward to your ideas.

 

Cheers,

Jochen

1 Expert replyverified_user

Syncing Shared Library Negative Keyword Lista accross (MCC) accounts

Rising Star
# 2
Rising Star

Hey Jochen, 

 

I looked into this and it looks like Frederick Vallaeys from SearchEngineLand posted an article over a year ago where he shares a script to share negative keywords across accounts. I don't think I'm allow to post the link here but search "Cross-Account Negative Keywords & Other MCC Tricks" in Google. Also I will be posting the code below. Again, credit goes to Frederick Vallaeys from SearchEngineLand. 

 

function main() {
var accountFlags = {
'1425022273': {
'campaignsToUpdate': 'Brand campaign, Another campaign',
},
'2676612512': {
'campaignsToUpdate': 'Sweatshirts campaign',
}
};

var accountSelector = MccApp.accounts()
.withLimit(50);

// Process the account in parallel. The callback method is optional.
accountSelector.executeInParallel("processAccount", null, JSON.stringify(accountFlags));
}

function processAccount(sharedParameter) {
var NEGATIVE_MASTER_LIST = "https://docs.google.com/spreadsheets/d/1sfdez-_yuyOpG4LORuQ6jcvIAK6LCcPr3bS9Quh-mqs/edit#gid=0"

var negativeKeywordSpreadsheet = SpreadsheetApp.openByUrl(NEGATIVE_MASTER_LIST);
var negativeSheet = negativeKeywordSpreadsheet.getActiveSheet();
var negativeRows = negativeSheet.getDataRange();
var negativeNumRows = negativeRows.getNumRows();
var negativeNumColumns = negativeRows.getLastColumn();
var negativeValues = negativeRows.getValues();
//var campaignsToUpdate = "Brand";

var customerId = AdWordsApp.currentAccount().getCustomerId().replace(/-/g, "");
Logger.log("customerId: " + customerId);
var accountFlags = JSON.parse(sharedParameter);
Logger.log("accountFlags: " + accountFlags);
var campaignsToUpdate = accountFlags[customerId].campaignsToUpdate;
Logger.log("campaignsToUpdate: " + campaignsToUpdate);

if(campaignsToUpdate) {
var campaignsToProcess = campaignsToUpdate.split(",");
Logger.log("campaignsToProcess.length: " + campaignsToProcess.length);
for(var i = 0; i < campaignsToProcess.length; i++) {
//var campaignKeywords = new Array();
var campaignName = campaignsToProcess[i];
campaignName = campaignName.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
Logger.log(campaignName);

var campaigns = AdWordsApp.campaigns()
.withCondition('Name = "' + campaignName.replace(/[\"]/g, "") + '"')
.get();

while(campaigns.hasNext()) {
var campaign = campaigns.next();
}


for(var negativeLineCounter = 0 ; negativeLineCounter < negativeNumRows; negativeLineCounter++) {

var negativeKeyword = "" + negativeValues[negativeLineCounter];
var negativeKeywordText = negativeKeyword.replace(/[\"\[\]]/gi, '');
Logger.log(negativeKeywordText);
campaign.createNegativeKeyword(negativeKeyword);

}

} // END for(var i = 0; i < campaignsToProcess.length; i++)

} // END if(campaignNegativeList)
}

Joshua, Rising Star
Was my response helpful? If yes, please mark it as the ‘Best Answer.’

Syncing Shared Library Negative Keyword Lista accross (MCC) accounts

Follower ✭ ✭ ☆
# 3
Follower ✭ ✭ ☆

Thanks for the tip Joshua. I had read the article. However, I was under the impression the script doesn't use the shared library's campaign negative keywords but the "old" way of adding them to individual campaigns. I preferer to use the shared library to have a better overview. I will test this and post the outcome here as well.

Syncing Shared Library Negative Keyword Lista accross (MCC) accounts

[ Edited ]
Follower ✭ ✭ ☆
# 4
Follower ✭ ✭ ☆

Hey there, I ran the test and can confirm it works the way I had expected: Negatives are added in campaign level and not in shared library. Might still be the best available solution for now. Cheers!

Syncing Shared Library Negative Keyword Lista accross (MCC) accounts

Follower ✭ ✭ ☆
# 5
Follower ✭ ✭ ☆

Sometimes the answer is closer than you think. I have just found and tried a Script provided by Google that does exactly what I was after: https://developers.google.com/adwords/scripts/docs/solutions/mccapp-master-negative-list