Google Ads Script - Negative Keyword Conflicts Not Working

596 views
Skip to first unread message

Pathfinder Marketing

unread,
Oct 5, 2022, 2:30:54 AM10/5/22
to Google Ads Scripts Forum
Hi,

I'm getting this message - "TypeError: Cannot read property 'clearContent' of null at initializeSpreadsheet (Code:310:40) at main (Code:92:3)" when I run the Negative Keyword Conflicts script. 

See screenshot >> https://prnt.sc/2M-i7BDT58cg

I'm using this script - https://developers.google.com/google-ads/scripts/docs/solutions/negative-keyword-conflicts

Does anyone know why this issue is happening? Please help. 

Pathfinder Marketing

unread,
Oct 5, 2022, 3:33:53 AM10/5/22
to Google Ads Scripts Forum
Never mind, fixed it

Google Ads Scripts Forum Advisor

unread,
Oct 5, 2022, 5:46:23 AM10/5/22
to adwords...@googlegroups.com

Hello,

James here, from the Google Ads scripts support team. Thank you for reaching out to us.

I’m glad that you’re able to fix the issue on your end. Please let us know if you need anything else from us.

Regards,

Google Logo
James Howell
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2exYoe:ref

Pathfinder Marketing

unread,
Oct 5, 2022, 10:21:57 PM10/5/22
to Google Ads Scripts Forum
Hi James,

I fixed it by turning off the new scripts experience.

Is there a way to keep the new scripts experience on and for it to work properly? See screenshot of what happens when I turn it off >> https://prnt.sc/BePVWd_brQV_

Currently if we have to leave the new script experience off for 'Quality Score Daily Tracker' and 'Negative Keyword Conflicts' for it to work properly but we would like to leave the new script experience on.

Any suggestions on how to fix this?

Nils Rooijmans

unread,
Oct 6, 2022, 1:07:52 AM10/6/22
to Google Ads Scripts Forum
most probably you are still running the old (deprecated) version of the scripts.

Try running the latest version that is optimized for the new scripting environment:

Hope this helps the readers over here,

Nils Rooijmans
https://nilsrooijmans.com
See my Google Ads Scripts FAQ to avoid the same mistakes I made: https://nilsrooijmans.com/google-ads-scripts-faq/

Google Ads Scripts Forum Advisor

unread,
Oct 6, 2022, 3:29:12 AM10/6/22
to adwords...@googlegroups.com

Hello,

 

Michael here and I work along with James.

 

I believe the settings for toggling on and off the new scripts experience toggle button is exclusive for each scripts. Thus, if you toggle off this button for 'Quality Score Daily Tracker' script and you toggle it on for 'Negative Keyword Conflicts' it will retain its setting as it is. This should not affect the other scripts.

 

Additionally, this Negative Keyword Conflicts you follow is a guide to work on new scripts experience. Thus, you are getting the error when being run on legacy mode. Kindly ensure that you run this with the toggle button on for new scripts experience and the issue should not persist anymore.

 

Let us know should you have other questions.

Regards,

Google Logo
Michael Angelo
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2exYoe:ref

Pathfinder Marketing

unread,
Oct 7, 2022, 3:19:17 AM10/7/22
to Google Ads Scripts Forum
@Nils Rooijmans - We are using this script already, but thanks for your input.

@Michael - I think you misunderstood the question. We want the 'Quality Score Daily Tracker' & 'Negative Keyword Conflicts' to run when we toggle on the new scripts experience, however, because both show errors when we run them we are forced to toggle it off. So, my question is how can we get both scripts to run properly with the new scripts experience toggled on? Please read the question carefully and let me know your thoughts. Thank you

Nils Rooijmans

unread,
Oct 10, 2022, 2:46:13 AM10/10/22
to Pathfinder Marketing via Google Ads Scripts Forum
just checking: in the Neg KW Conflict script, did you seet the spreadsheet variable at the tline that says:

 SPREADSHEET_URL: 'YOUR_SPREADSHEET_URL',

?

See setup instructions:

Setup

  • Set up a script with the source code below. Use a copy of this template spreadsheet.
  • Don't forget to update SPREADSHEET_URL and RECIPIENT_EMAILS in your script.
  • Optionally, provide a CAMPAIGN_LABEL so that the script operates on only a subset of your campaigns.


 

--
-- 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/Aj1SOGunAq0/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/c4db5ae8-0fa4-444f-b2d4-3e6db8236a82n%40googlegroups.com.

Google Ads Scripts Forum Advisor

unread,
Oct 10, 2022, 11:17:49 PM10/10/22
to adwords...@googlegroups.com

Hi,

 

This is Yasmin from the Google Ads scripts team.

 

@Nils - Thank you for providing your assistance on this.

 

Thank you for clarifying further and providing more context. I do believe that the script Negative Keyword Conflicts - Single Account should be generated in the new script experience version, with the button toggled on, as this script is built to be generated in the said version. That said, adding on to Nils' response, could you please confirm if you've supplied a copy of the template spreadsheet for your script, as the method clearContents() clears the sheet of contents? If not, kindly use a copy of this template spreadsheet (as what's stated in the Setup section of this solution script) and don't forget to update the SPREADSHEET_URL (and RECIPIENT_EMAILS) of your script.

 

If you are still experiencing an error with a spreadsheet supplied and after generating this in the new script experience version, it would be highly appreciated if you can provide the following information so we can investigate this further:

  • Google Ads account CID / ID
  • Script name
  • Screenshot of the error
  • Shareable link of your spreadsheet (guide on Share a file publicly)

 

Kindly send the requested items via `Reply privately to author` option. If the said option is not available on your end, you may send those through the email alias `googleadsscr...@google.com` instead.

 

Kind regards,

 

Google Logo
Yasmin Gabrielle
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2exYoe:ref

Nils Rooijmans

unread,
Jul 26, 2023, 6:19:36 AM7/26/23
to Google Ads Scripts Forum
just a FYI for the scripting community here.

The original script has been updated by Google, but it has a major drawback;
it also looks at keywords in campaigns that have ended (ie: ended experiment campaigns).

This results in a lot of false alerts, making you want to ignore them altogether.

So I decided to fix this issue by changing the script to only look at campaigns that are still serving.

This fix was easy. The only thing I need to add was the condition to only look at campaigns with serving_status = 'SERVING'.

In the code that means one extra condition in the GAQL query:

    `WHERE campaign.status = "ENABLED" AND campaign.serving_status = "SERVING" AND ad_group.status = "ENABLED" `+


Google Ads Script - Negative Keywords Conflicts - Updated version

URL: https://nilsrooijmans.com/negative-keyword-conflicts-alert-script-update/

Hope this helps,


Nils Rooijmans
https://nilsrooijmans.com
See my Google Ads Scripts FAQ to avoid the same mistakes I made: https://nilsrooijmans.com/google-ads-scripts-faq/

Jeroen de Boer

unread,
Aug 20, 2024, 8:49:26 AM8/20/24
to Google Ads Scripts Forum
Hi Nils

Hope you can help, getting a error when running this script, have tried labels on campaigns and without, neitehr seems to work.
Error is "Failed to retrieve shared list. Error says TypeError: Cannot read properties of null (reading 'negativeKeywords')"

This by the way is the template script

Any ideas?

Google Ads Scripts Forum Advisor

unread,
Aug 20, 2024, 1:43:50 PM8/20/24
to adwords...@googlegroups.com
Hi,

I would like to inform you that the Negative Keyword Conflicts script was removed from the Google Ads Scripts document. Please note that we explicitly do not support the deprecated solutions that no longer appear on the developers site. The solutions we do support are the ones that are now supported in the new Google Ads account (UI) "Tools > Bulk Actions > Solutions" menu.

If you are facing any issues with the other scripts, please share with us the following details :
  • Google Ads account ID or CID
  • Name of the affected script
  • If the script uses a spreadsheet, kindly provide the shareable link to the spreadsheet to share a file publicly. 
This message is in relation to case "ref:!00D1U01174p.!5004Q02exYoe:ref" (ADR-00152299)

Thanks,
 
Google Logo Google Ads Scripts Team


Fara Zezima

unread,
Aug 22, 2024, 10:56:33 PM8/22/24
to Google Ads Scripts Forum on behalf of adsscripts
okay

--
-- 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 the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-scrip...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/2qYyC000000000000000000000000000000000000000000000SIJ2KE00W-hLlIwcQNurs0ny4yfTDw%40sfdc.net.
Reply all
Reply to author
Forward
0 new messages