Removing negative keywords in Shopping campaigns

113 views
Skip to first unread message

Tamsin Mehew

unread,
Sep 16, 2015, 9:01:00 AM9/16/15
to AdWords Scripts Forum
Hi,

I'm trying to get a selector for the negative keywords in shopping campaigns (so they can be modified or removed).

The documentation (https://developers.google.com/adwords/scripts/docs/reference/adwordsapp/adwordsapp_shoppingcampaign) says that AdWordsApp.​ShoppingCampaign has the method 'negativeKeywords', which returns a selector of the campaign-level negative keywords. (Also 
"negativeKeywords() : NegativeKeywordSelector" appears in the auto-complete while I'm typing the code.)

However whenever I try to use this method I get the error "TypeError: Cannot find function negativeKeywords in object [shopping campaign {name of campaign}]. (line 5)".

Sample code:
function main() {
 
var campaignIterator = AdWordsApp.shoppingCampaigns().get();
 
while (campaignIterator.hasNext()) {
   
var campaign = campaignIterator.next();
   
var negativeIterator = campaign.negativeKeywords().get();
   
while (negativeIterator.hasNext()) {
     
var negative = negativeIterator.next();
     
   
}
 
}
}

Is it possible to access a Shopping campaign's negative keywords?

Thanks,
Tamsin

Anash Oommen

unread,
Oct 5, 2015, 5:37:36 PM10/5/15
to AdWords Scripts Forum
Hi Tamsin,

Apologies for the delay. I have filed this as a feature request with the team.

Cheers,
Anash P. Oommen,
AdWords Scripts Team.

Tyler Murphy

unread,
Nov 9, 2015, 4:54:14 PM11/9/15
to AdWords Scripts Forum
I was also tricked by the documentation into believing this exists. I'm looking forward to this feature!

Naman Jindal

unread,
Apr 29, 2016, 3:24:11 AM4/29/16
to AdWords Scripts Forum
Hey Guys,

Any update on this? 
It seems that the scripts can still not access the Negative Keywords for Shopping Campaigns. But the documentation says that it can. If the feature is not yet available request you to please take it off the documentaion and please prioritise the feature request.

Regards,
Naman Jindal

Anash Oommen

unread,
Apr 29, 2016, 3:01:10 PM4/29/16
to AdWords Scripts Forum
Hi Naman,

I don't have any updates on the feature yet, but I'll ask our techwriter to leave a note about this behaviour.

Cheers,
Anash P. Oommen,
AdWords Scripts Team.

Max Meyn

unread,
Nov 16, 2016, 3:57:20 PM11/16/16
to AdWords Scripts Forum
Hi Anash,
Is this highly appreciated feature to be implemented in the near future?
Cheers,
Max

Tyler Sidell (AdWords Scripts Team)

unread,
Nov 16, 2016, 5:10:04 PM11/16/16
to AdWords Scripts Forum
Hi Max,

You should be able to get negative keywords from shopping campaigns using the following code.

function main() {
 
var campaignIterator = AdWordsApp.shoppingCampaigns().get();
 
while (campaignIterator.hasNext()) {
   
var campaign = campaignIterator.next();
   
var negativeIterator = campaign.negativeKeywords().get();
   
while (negativeIterator.hasNext()) {
     
var negative = negativeIterator.next();
   
      negative
.remove();  
   
}
 
}
}

In the future, would you mind opening a new thread for better tracking purposes?

Thanks,
Tyler Sidell
AdWords Scripts Team
Reply all
Reply to author
Forward
0 new messages