Put Script Code in external file?

360 views
Skip to first unread message

Bernhard Prange

unread,
Feb 6, 2017, 4:06:13 AM2/6/17
to AdWords Scripts Forum
Hi. Is there a way to load the majority of the script code from an external source? That would be handy because I have a lot of single accounts to change if I update a script. 

Thanks

Bernhard

Anthony Madrigal

unread,
Feb 6, 2017, 12:04:46 PM2/6/17
to AdWords Scripts Forum
Hi Bernhard,

I'm afraid there is no way to load a script from an external file using AdWords Scripts.

Regards,
Anthony
AdWords Scripts Team

Trevor

unread,
Feb 7, 2017, 2:21:46 PM2/7/17
to AdWords Scripts Forum
Hi Bernhard,

You could always try to use javascript's eval() function as they do here: https://www.evernote.com/pub/narch2002002/adwordsscripts#st=p&n=eb38539d-e955-44c4-bb69-dbcd961f80eb

eval() is dangerous though and most people would tell you not to do it. If anyone got access to the .js file you're fetching and if your script ran on a schedule, any code inserted into the .js file would run authorized as you and do whatever they wanted it to. 

Bernhard Prange

unread,
Feb 8, 2017, 7:42:05 AM2/8/17
to Trevor via AdWords Scripts Forum
=-O I already saw that eval is working in the scripts. But I did not
consider this Option. Thanks for pointing that out.

Stephen Howe

unread,
Feb 8, 2017, 7:51:32 AM2/8/17
to AdWords Scripts Forum
Are the single accounts under an MCC? If so, an MCC script would be perfect for this. You just have to modify a single function that the MccApp will perform as it iterates over the accounts.

Sven Reinhardt

unread,
Feb 8, 2017, 9:12:10 AM2/8/17
to AdWords Scripts Forum
maybe this is an option for you: http://www.freeadwordsscripts.com/2013/10/use-gdrive-to-load-single-adwords.html

before we switched to MCC-Scripts we used a similar solution. Account-specific data was stored in spreadsheets and called when needed.
Reply all
Reply to author
Forward
0 new messages