Get the name of the script in the script

24 views
Skip to first unread message

Guido van den Born

unread,
May 28, 2020, 9:04:41 AM5/28/20
to Google Ads Scripts Forum
Hi all,

I'm wondering if it is possible to reference the name of the script itself in the script. I'm adding code to send an e-mail when the script runs into an error. It would be nice if this e-mail contained the name of the actual script that failed to run. I could type out the name, but I'm looking for a way to not have to do that. I'd like it to be flexible and dynamic.

I'm using the method described on the link below btw. If anyone knows a better way of getting alerts when scripts are failing, please let me know :)


Thanks for any help in advance!

Google Ads Scripts Forum Advisor

unread,
May 28, 2020, 11:25:46 AM5/28/20
to adwords-scripts+apn2wqd-jpapa3bs...@googlegroups.com, adwords-scripts+apn2wqd-jpapa3bs...@googlegroups.co, adwords...@googlegroups.com
Hello,

At the moment, the scripts library does not have a property or method that can get the script's name. For new feature additions, please see our blog.

Thanks,
Matt
Google Ads Scripts Team

ref:_00D1U1174p._5004Q1zsYLL:ref

Guido van den Born

unread,
May 29, 2020, 7:39:59 AM5/29/20
to Google Ads Scripts Forum
Hi Matt,

Thanks for letting me know! It's a shame, but we'll figure something out.

Sigurd

unread,
Jun 4, 2020, 11:46:48 AM6/4/20
to Google Ads Scripts Forum
Unfortunately, it's not possible to get the name from Google Ads, so I usually include the name in a global variable I have at the very top of my scripts with other stuff I'll need throughout.

var settings = {

   scriptName
: 'Name of script',
   somethingElse
: 'whatever',

}
Reply all
Reply to author
Forward
0 new messages