Here’s a script for copying labels between levels

If you’ve ever run an AdWords account before, you’ll know why being able to copy labels between levels is such a godsend.

In a typical account, you generally deal with hundreds, or even thousands of campaigns, within which there can be thousands more ad groups and keywords. Without proper labeling, things can get very messy… which is bad.

It comes up all the time: you label a campaign but then can’t spot the label when looking at all your keywords from the various campaigns you’re running. For example, you want to push bids for a certain brand’s keywords, but you’ve only got campaigns labeled with brands.

Kudos to Google for updating AdWords Editor so you can filter by campaign and ad group label, so you’re not helpless in this situation! But opposite of kudos for not applying this very useful change to the web interface, too.

And there are some labeling dilemmas where neither the web interface nor Editor cut the mustard. Sometimes you just want to see the label, rather than filter by it, for example.

And what about when you want to see keyword and ad labels when looking at campaigns or ad groups? Currently, you can’t. Maybe you’re making major bid adjustments to a set of ad groups, so you label them accordingly, but then on the campaign overview this doesn’t show up. Annoying, and potentially confusing when you’re trying to explain a change in CPC or whatever else.

Brainlabs (my employer) is here to fill in the gaps. Here’s a script that will conquer your labeling woes once and for all.

To use the script, copy the code below into AdWords, and then change the options at the top:

  • campaignNameContains and campaignNameDoesNotContain filter which campaigns the script gets data from. For example, if campaignNameContains is [“Brand”, “Generic”], then only campaigns with names containing “brand” or “generic” are included. If campaignNameDoesNotContain is [“Display”, “Competitor”] then any campaigns with names containing “display” or “competitor” are ignored.
    • This is not case-sensitive.
    • Leave blank, [], to include all campaigns.
    • If you need to put a double quote into campaignNameContains or campaignNameDoesNotContain, put a backslash before it.
  • ignorePausedCampaigns, ignorePausedAdGroups and ignorePausedAdsAndKeywords filter which entities the script looks at based on status. They should all be set to “true” if you only want to look at currently active things.
    • Removed things are always ignored — they’re deleted, so it’s not like you can change them!
  • Fill in labelNames with the names of the labels you want copied.
    • Note that this is case-sensitive — type carefully!
  • copyLabelsFrom is the type of entity you’re copying labels from.
  • copyLabelsTo is the type of entity you’re copying labels to.
    • copyLabelsFrom and copyLabelsTo can be any of “Campaign,” “AdGroup,” “Keyword” and “Ad.”
    • You can’t copy labels from keywords to ads, or from ads to keywords.
  • threshold is used if you are copying labels from a lower level to a higher one — for example, from keywords to campaigns, or from ads to ad groups. It is the proportion of lower-level entities that must be labeled for the label to be inherited to the higher-level entity.
    • For example, if copyLabelsTo is “Campaign,” copyLabelsFrom is “Keyword” and threshold is 0.5, then labels will be applied to campaigns where 50 percent of the keywords are labeled.
    • It should be a number between 0 and 1 inclusive.
    • If threshold is 1, then the higher level entity will only be labeled if all of the lower level entities within are labeled.
    • If threshold is 0, then the higher level entity will be labeled if any of the lower-level entities within are labeled.


  • This doesn’t work for Shopping, Video or Universal App campaigns.
  • AdWords Scripts can only run for 30 minutes. If your account is too big for the script to run, you could run it multiple times. Use campaignNameContains and campaignNameDoesNotContain to go over different parts of the account each time.
  • If you want to label all ads within an ad group where the keywords are labeled, then you can run the script twice: once to copy the label from the keywords to ad group level, and then to copy the label from the ad group to the ads.

The post Here’s a script for copying labels between levels appeared first on Search Engine Land.