Scripting whitelisting issues

Skip to first unread message

Koen Martens

Sep 15, 2021, 5:55:30 AMSep 15
to Google Ads Scripts Forum
Hi all,

Our link checker scripts don't run because the website is blocking external user agents. Does anyone know which Google user agent has to be whitelisted when using scripts?

Sigurd Fabrin

Sep 15, 2021, 7:26:52 AMSep 15
to Google Ads Scripts Forum
UrlFetchApp uses "User-Agent": "Mozilla/5.0 (compatible; Google-Apps-Script)" - and it cannot be changed, apparently. 

Another possibility is to add a query string to the URLs via the script, before visiting them - And then tell your server to let traffic with this parameter pass. That way you're not opening the floodgates to all sorts of bots.
Something like

Google Ads Scripts Forum Advisor

Sep 16, 2021, 2:32:11 AMSep 16
Hi Sigurd,

Thank you for sharing your knowledge to the community.


You may try the suggestion provided by Sigurn. Furthermore, please do note that the link checker script utilizes Google Apps Script's UrlFetchApp method to actually check your URLs. The said, we would recommend reaching out to Apps Script team for further assistance. The developer support their should be able to shed light and provide in-depth insight regarding this.

Google Logo
Teejay Wennie Pimentel
Google Ads Scripts Team

Reply all
Reply to author
0 new messages