AdWords
6.1K members online now
6.1K members online now
Use AdWords conversion tracking and reporting to measure your results. Have a question about Google Analytics? Post it here, on the Google Analytics Community!
Guide Me
star_border
Reply

Google Scripts

Follower ✭ ☆ ☆
# 1
Follower ✭ ☆ ☆

Hi,

While adding new "Keyword Performance" script for reporting purpose. There is a runtime error with message

TypeError: Cannot call method "getRange" of null. (line 15)

 

Can anyone helps me to rectify it.

Script URL : https://developers.google.com/adwords/scripts/docs/solutions/keyword-performance

with email set to couponalbum3@gmail.com

and spreadsheet url as : https://docs.google.com/spreadsheets/d/15F4ndqVd_P3FkiET5DvkmjKZNX5Dom3fBcWFKvGwsGI/edit?usp=sharing

 

Thanks in advance

2 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by MosheTLV (Top Contributor)
September 2015

Re: Google Scripts

Top Contributor
# 2
Top Contributor
Hello, Coupon A.

Please refrain from using e-mails and personally identifiable data in this community's posts for your own safety.

I've tested the sample script you're referring to and my guess is that you edited the URL of the default spreadsheet template, which has to be a public spreadsheet.

Your spreadsheet URL is not public, I need to request access from you to be able to see it. If it isn't then this may be a reason for that error, because the script cannot read a range from an inaccessible URL.

Please check and let us know if this was the case.
Calin Sandici, AdWords Top Contributor | Find me on: Google+ | Twitter | LinkedIn | myBlog
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.

View solution in original post

Marked as Best Answer.
Solution
Accepted by MosheTLV (Top Contributor)
September 2015

Re: Google Scripts

Top Contributor
# 2
Top Contributor
Hello, Coupon A.

Please refrain from using e-mails and personally identifiable data in this community's posts for your own safety.

I've tested the sample script you're referring to and my guess is that you edited the URL of the default spreadsheet template, which has to be a public spreadsheet.

Your spreadsheet URL is not public, I need to request access from you to be able to see it. If it isn't then this may be a reason for that error, because the script cannot read a range from an inaccessible URL.

Please check and let us know if this was the case.
Calin Sandici, AdWords Top Contributor | Find me on: Google+ | Twitter | LinkedIn | myBlog
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.

Re: Google Scripts

Top Contributor
# 3
Top Contributor

Hi Coupon A, Calin is right, this error message is typically seen when the script does not have permission to write to the spreadsheet linked in the code.

 

Make sure you copy the original template spreadsheet into your own Drive, then ensure it's shared with appropriate permissions for the authorised owner of the AdWords script to change the spreadsheet.

 

Jon

AdWords Top Contributor Google+ Profile | Partner Profile | AdWords Audits

Re: Google Scripts

Follower ✭ ☆ ☆
# 4
Follower ✭ ☆ ☆
Thanks for your replies. I change my spreadsheet access to public. But the error still persist.

Re: Google Scripts

Top Contributor
# 5
Top Contributor

Hi Coupon A, the spreadsheet who's URL you shared in your first place does not appear to be a copy of the spreadsheet template used by the script.  It's very important that you copy this exact template:

 

http://goo.gl/27L9k8

 

share it with appropriate access and use its sharing URL in the script.


Jon

AdWords Top Contributor Google+ Profile | Partner Profile | AdWords Audits