Detect duplicate keywords with this Google Ads script

Managing keywords isn’t as complicated as you think. Many advertisers act like a cloud hangs over them when identifying and eliminating duplicate keywords. Because these keywords can lead to higher costs and lower ad quality scores.

If your Google Ads campaigns underperform, consider checking for duplicate keywords—it’s worthwhile. However, how can you look for these keywords in your Google Ads campaigns? Wouldn’t it take us hours to do this manually? As fatigue increases, so does the likelihood of making mistakes.

We offer a Google Ads script that automates the detection of duplicate keywords in campaigns and ad groups. Easy to use and customizable. With this script, you can detect and remove them. And it’s free of charge.

On this post
    Detect duplicate keywords with this Google Ads script

    Why are there duplicate keywords?

    If an account has been running managed by different people, this may happen over time. Also, the keyword addition process changes over time, which can unexpectedly lead to duplicate keywords.

    In some cases, product feeds generate thousands of keywords automatically. However, the feed quality isn’t perfect in most cases, and the result may be duplicate keywords. In this case, you need to find them quickly and make them unique somehow by adding descriptive words.

    Why should you eliminate duplicate keywords?

    • Cost savings: You can reduce your cost-per-click (CPC) and overall ad spend, allowing you to allocate your budget more effectively.
    • Improved ad quality scores: You can improve your ad relevance and landing page experience, leading to higher quality scores and better ad positions.
    • Enhanced campaign performance: With a streamlined and well-organized keyword list, you can make more informed decisions and optimize your campaigns for maximum ROI.

    Google Ads script to the rescue: Labeling the duplicate keywords for further actions

    // SEAlyzer:Labeler:DuplicateKeywords
    // Author: Stefan Neefischer (info@pemavor.com)
    
    var keywordcount = []
    var duplicates = []
    
    function main() {
      labelname = "SEAlyzer_DuplicateKeyword"
      	// Add your label by hand or uncomment the next line once
      	// AdWordsApp.createLabel(labelname);
      fetchAwqlReport()
      	for (var d in duplicates) {
        	setLabel(d,labelname)
        } 
    }
    
    function setLabel(keywordid,labelname) {
      var keywordIterator = AdWordsApp.keywords().withCondition('LabelNames CONTAINS_NONE ["'+labelname+'"]').withCondition('Id = '+ keywordid).withCondition('Status = "ENABLED"').get();
      	while (keywordIterator.hasNext()) {
        	var keyword = keywordIterator.next()
           	keyword.applyLabel(labelname)
        }
    }
    
      
    function fetchAwqlReport() {
      report = AdWordsApp.report("SELECT Id, Criteria FROM KEYWORDS_PERFORMANCE_REPORT WHERE Status = 'ENABLED'")
      	var rows = report.rows()
      while (rows.hasNext()) {
        	var row = rows.next()
        	var id = row["Id"]
          	var keyword = row["Criteria"]
            if (!keywordcount[id]) {
            	keywordcount[id] = id
            }
          	else {
            	duplicates[id] = 1
            } 	
      }
    }
    

    How the Google Ads script works

    1. Load the Keyword Performance Report.
    2. Find duplicate Keywords across Campaigns and Ad Groups (Draft and Experiments have to be excluded.)
    3. Label the duplicate Keywords.

    Revolutionize your ad campaigns with our custom scripting solutions

    We offer custom Google Ads scripts for various needs, such as automating duplicate keyword detection, improving ad quality, and effectively managing budgets. Don’t let manual processes hinder your success -partner with us to leverage the full potential of Google Ads scripts and achieve outstanding results. Reach out to our team today and elevate your campaigns to new heights.

    More Similar Posts