Exclude search terms based on criteria

843 views
Skip to first unread message

Amine Bis

unread,
Mar 2, 2020, 5:40:24 PM3/2/20
to Google Ads Scripts Forum
Hello again
I am looking for a script that exclude all search terms that meet certain criteria from all my shopping campaigns. So basically the script will go over all search terms for all active shopping campaigns and excludes ones that meet certain criteria.
Example of criteria:
- Search term cost > 5 and conversions = 0 in last 4 days ==> exclude the search term
Thanks

Google Ads Scripts Forum Advisor

unread,
Mar 3, 2020, 12:30:12 AM3/3/20
to adwords...@googlegroups.com
Hi Amine,

I am afraid that the provided use case is not possible because of the following reasons:
1. Excluding the search term itself is currently not possible.
2. According to this guide, setting your keywords as negative let you exclude search terms from your campaigns. However, setting of negative keywords to shopping campaigns is currently not possible via the Google Ads scripts.

Let me know if you have further questions.

Regards,
Ejay
Google Ads Scripts Team

ref:_00D1U1174p._5001UXTtuI:ref

Sigurd

unread,
Mar 3, 2020, 3:38:47 PM3/3/20
to Google Ads Scripts Forum
@Ejay, not entirely sure that is a correct answer.

@Amine: You can write such a script with a little effort and a lot of googling or you can hire someone to write it for you.
You probably wanna add the search terms to a shared negative keyword list and apply that list to your shopping campaigns afterwards. Here's a place to start https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_negativekeywordlist

 sigurd

Google Ads Scripts Forum Advisor

unread,
Mar 3, 2020, 5:02:02 PM3/3/20
to adwords-scripts+apn2wqevinbbivog...@googlegroups.com, adwords...@googlegroups.com
Hi Amine,

Adding to Sigurd's post, the search query report solution that can be found here, is a good start. The page describes how to work with search terms, that you can filter based on chosen criteria. The source code provided at the bottom of the page is a script that adds search terms as negative or positive keywords depending on whether if they meet certain metric thresholds. You can edit these thresholds and add/remove metrics as needed. If you are not interested in adding positive keywords, you can easily remove this functionality, by changing the line:

  if (positiveKeywords[adGroup.getId()]) { 

to:

if (0) { //Condition will never fire

Additionally, if you want this script focused on shopping ad groups, you'll have to change the lines:

  var adGroups = AdsApp.adGroups().withIds(adGroupIdList).get();
  while (adGroups.hasNext()) {
    var adGroup = adGroups.next();

to:

  var adGroups = AdsApp.shoppingAdGroups().withIds(adGroupIdList).get();
  while (adGroups.hasNext()) {
    var adGroup = shoppingAdGroups.next();

You may need to make other changes to tailor the script to your exact need. 

Regards,
Matt

Amine Bis

unread,
Mar 3, 2020, 9:17:25 PM3/3/20
to Google Ads Scripts Forum
@Sigurd thanks a lot mate for your answer and sugegstion, i thought there were no way to do this because of the previous reply! btw, can you suggest me someone to hire if you have experience with that?
@Matt thanks a lot for the answer, it was really helpful, i will see what i can do with both your replies.

Google Ads Scripts Forum Advisor

unread,
Mar 4, 2020, 1:50:25 AM3/4/20
to adwords...@googlegroups.com
Hi,

Sigurd, thank you for providing suggestion. The workaround that you provided is correct and could be used to that specific use case.

To Amine, my apologies for the confusion. You may try to implement the suggestions provided by Matt and Sigurd. Let us know if you have questions/clarifications with it.

Regards,
Ejay
Reply all
Reply to author
Forward
0 new messages