Last active
September 24, 2020 19:42
-
-
Save siliconvallaeys/7237627acfe805d0d58aaab62249c93b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This simple script can be used in conjunction with Optmyzr's | |
// budget management scripts. | |
// uncomment either line 14 or 15 depending on whether you want to ADD or REMOVE the label | |
function main() { | |
var campaignIterator = AdsApp.campaigns().get(); | |
Logger.log('Total campaigns found : ' + | |
campaignIterator.totalNumEntities()); | |
while (campaignIterator.hasNext()) { | |
var campaign = campaignIterator.next(); | |
var campaignName = campaign.getName(); | |
Logger.log(campaignName); | |
campaign.applyLabel(campaignName); // <-- use this to add the label | |
//campaign.removeLabel(campaignName); // <-- use this to remove the label | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment