Skip to content

Instantly share code, notes, and snippets.

@russorat
Last active November 20, 2015 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save russorat/296d0f3a16f1520c9aba to your computer and use it in GitHub Desktop.
Save russorat/296d0f3a16f1520c9aba to your computer and use it in GitHub Desktop.
/***********
* Helper function to create the labels in the account
* that will be used to keep track of Keywords in limbo.
***********/
function createLabelsIfNeeded(days_in_limbo) {
for(var i = 1; i<=days_in_limbo; i++) {
var label_name = 'Deleting in '+i+' days';
if(!AdWordsApp.labels().withCondition("Name = '"+label_name+"'").get().hasNext()) {
AdWordsApp.createLabel(label_name,
'These entities will be deleted in '+i+
' days. Created by an AdWords Script.');
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment