Editing MCC level Negative Keyword List from Ads Manager script not possible?

264 views
Skip to first unread message

Martijn Kraan

unread,
Nov 1, 2019, 10:54:22 AM11/1/19
to Google Ads Scripts Forum
Hi,

I'm trying to edit an MCC level negative keyword via a script running on MCC level. Preview mode works fine, but when running the script I get the error "Item not found"
  • Edit account list from account script -> works
  • Edit MCC list from account script -> works
  • Edit MCC list from MCC script -> does not work
Is there a fix for this?

Greetings, Martijn

Google Ads Scripts Forum Advisor

unread,
Nov 1, 2019, 3:39:53 PM11/1/19
to adwords-scripts+apn2wqeiau4hbtxb...@googlegroups.com, adwords-scripts+apn2wqeiau4hbtxb...@googlegroups.co, adwords...@googlegroups.com
Hi Martijn,

I am able to add to negative keywords to an existing list at the MCC level with an MCC script. Can you please provide your CID and script name so I can investigate the issue in your account? If you are operating from a higher MCC, please provide any relevant account IDs.

Regards,
Matt 
Google Ads Scripts Team

ref:_00D1U1174p._5001UMuXT2:ref
Message has been deleted

Martijn Kraan

unread,
Nov 11, 2019, 4:57:50 AM11/11/19
to Google Ads Scripts Forum
Hi Matt,

Any updates on this issue yet by any chance?

Google Ads Scripts Forum Advisor

unread,
Nov 11, 2019, 2:55:46 PM11/11/19
to adwords-scripts+apn2wqeiau4hbtxb...@googlegroups.com, adwords-scripts+apn2wqeiau4hbtxb...@googlegroups.co, adwords...@googlegroups.com
Hi Martijn,

Thank you for providing access to the spreadsheet. I've tested your script and at the moment, the issue I see is that your negativeKeywords array contains an empty item at the end of the array, which throws the error when the array of negatives gets added to an existing negatives list:

  Invalid argument: keywordText. Should be of type: non-empty string (file Code.gs, line 82)

You understand the ranges better as the author of the script and spreadsheet, but a quick fix is just popping up off the last item of the array:

    //lastly, add the negative keywords to the list
    negativeKeywords.pop();
    negativeKeywordList.addNegativeKeywords(negativeKeywords);

Regarding the 'Item not found' error: I have reported this to our team for further review.

Martijn Kraan

unread,
Nov 15, 2019, 8:47:22 AM11/15/19
to Google Ads Scripts Forum on behalf of adsscriptsforumadvisor, adwords-scripts+apn2wqeiau4hbtxb...@googlegroups.com, adwords-scripts+apn2wqeiau4hbtxb...@googlegroups.co
Hi Matt,

Thanks for the reply and the supplied solution (.pop)

Any updates on the 'Item not found' error?

Met vriendelijke groet,


--
-- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
---
You received this message because you are subscribed to a topic in the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-scripts/rPwrwNqnT_8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-scrip...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/0DcXj000000000000000000000000000000000000000000000Q0TM0S00WrqONSb2QzKwpdZHZBMsuQ%40sfdc.net.

Martijn Kraan

unread,
Nov 15, 2019, 9:56:42 AM11/15/19
to Google Ads Scripts Forum
Hi Matt,

Aside from the "Item not found" error, is it even possible to edit a MCC-level list from either a account script of MCC script?

Google Ads Scripts Forum Advisor

unread,
Nov 15, 2019, 3:27:14 PM11/15/19
to adwords-scripts+apn2wqeiau4hbtxb...@googlegroups.com, adwords-scripts+apn2wqeiau4hbtxb...@googlegroups.co, adwords...@googlegroups.com
Hi Martijn,

Thanks for your patience on this -- our team still needs more time on this issue. It should be possible because once you use the AdsManagerApp select method, you change contexts into the child account.

Martijn Kraan

unread,
Nov 15, 2019, 3:35:57 PM11/15/19
to Google Ads Scripts Forum
Hi Matt,

Thanks for your quick repons. I've tested this with a very simple script in one of the Child accounts and got the same error:

function main() {


   
var negativeKeywordListSelector = AdsApp.negativeKeywordLists()
       
.withCondition('Name CONTAINS "Test list"')


   
var negativeKeywordListIterator = negativeKeywordListSelector.get();


   
while (negativeKeywordListIterator.hasNext()) {
       
var negativeKeywordList = negativeKeywordListIterator.next();
     
       
Logger.log(negativeKeywordList.getId());
       
Logger.log(negativeKeywordList.getEntityType());      
        negativeKeywordList
.addNegativeKeyword("shoes");
     
   
}
}

So does this mean that using the AdsManagerApp select method will probably not work? Or should I give it a go?

Google Ads Scripts Forum Advisor

unread,
Nov 18, 2019, 2:33:07 PM11/18/19
to adwords-scripts+apn2wqeiau4hbtxb...@googlegroups.com, adwords-scripts+apn2wqeiau4hbtxb...@googlegroups.co, adwords...@googlegroups.com
Hi Martijn,

I copied your script into my test environment, swapping out the name, and I was not able to recreate the error. Can you please provide the CID of the child account that you tested this in?

Thanks,

Martijn Kraan

unread,
Nov 19, 2019, 6:10:38 AM11/19/19
to Google Ads Scripts Forum
Hi Matt,

I've already found a workaround. Thanks for the help!

You can close this case :)
Reply all
Reply to author
Forward
0 new messages