Free Google Ads Script for Building Negative Keyword List to Negate Bad Search Terms

I have just scored 200th subscriber for this website and it’s time to celebrate with a free Google Ads script. I wrote a script for building negative keyword list which is free to use by anybody. Here is what the script does:

  1. It creates a new shared negative keyword list (if the list does not exist yet)
  2. It runs search query report looking for low performing queries (=high cost and no conversions)
  3. It compares existing keywords in the shared list against the bad queries from the latest run of the search query report
  4. If the script identifies missing badly performing queries, it will add them as exact negative keyword into the shared list
  5. It applies the shared list to all active campaigns
  6. If you buy the full versions, the script sends you confirmation email at the end (you should be using Google account for signing into Google Ads so the email can go out).

Alright, so how to use the thing?

  1. Download the script – you can get either free or full version. What’s the difference? In the full version, the script will send you an email in case new negative KWs are added. Free version will not send you this notification.DOWNLOAD FREE VERSION BUY FULL VERSION
  2. Copy the contents of the file and go to script section of your single Google Ads account (=NOT MCC Level)
  3. Create new script
  4. Paste the code
  5. Adjust the input parameters at the top of the script:
  6. Run preview
  7. Approve all the permissions
  8. Run the script for real
  9. Schedule it – ideally daily.

Enjoy 🙂

If you face any issues or the script is not working as expected, let me know in the comment section below!


***Tip: Have a question? Ask in the comment section below or in this Facebook group. You can also sign up for our free newsletter.***

***Do you feel like you need more help? We can help you with PPC Automation and/or with your reporting under our new project here.***

11 thoughts on “Free Google Ads Script for Building Negative Keyword List to Negate Bad Search Terms

      1. Hmm, I have been running the script like crazy here and I cannot see why you’re getting the message. It runs on my side no matter what scenario I try. Based on the message, it looks like the negative KW list is not being created for some reason (maybe some special characters in the name? Too long name?), so there is nowhere to add the neg kws to – which is done via line 95. By any chance, could I have a look into your account? I am really curious to see what the problem is.

        I slightly edited the part of the script around line 85, it may or may not help – I am not sure as I am not able to reproduce the problem. Any hint would be greatly appreciated.


  1. Hi Dan, thank you so much for the script. It worked really great for several days.
    But now I got an error – Parsing error. Please check your selector. (file, line 47)

    I tried it also with your new 1.1 version, but it shows me the same error.
    The search terms that should be excluded are neither containing more than 10 words nor are longer than 80 characters – so the it should not be the problem of the google ads limits.

    Do you have any idea, what is the issue?


    1. Hi Tomas,
      as discussed privately, you had incorrectly defined start date. It needs to be in YYYYMMDD format. (e.g. 20190101).


  2. Is it possible to export this into a google spreadsheet? I’d like to review the negative keyword list before uploading it.

    1. Hi Lola,
      in theory yes but the complexity would grow dramatically because you’d have to manually confirm you want to upload some KWs, you don’t want to upload some… Those KWs which you don’t want to upload should be moved to a black list so they are not ever suggested again.

      Then there would have to be second script actually adding approved neg KWs into negative lists.

      It would not be as seamless as now.


  3. Hi Dan
    Many thanks for this valuable script. I am running the script without any errors.

    However, the keywords are just not being added to the list. Any ideas? I have tried creating new negative keyword lists, but the keywords never get added.

    Can you please help?

  4. Never mind, I figured out what my issue was.

    I did not realize that “Preview” will not actually create the Negative KW List. Only the “Run” button will do that.

    Thank you for this amazing script! Works just as described.

Leave a Reply

Your email address will not be published. Required fields are marked *