Scripting whitelisting issues

24 views
Skip to first unread message

Koen Martens

unread,
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

unread,
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. 
See https://stackoverflow.com/questions/56099139/urlfetchapp-fetch-error-doesnt-seem-to-be-using-headers

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 www.example.com/?benignBot=true

Google Ads Scripts Forum Advisor

unread,
Sep 16, 2021, 2:32:11 AMSep 16
to adwords...@googlegroups.com
Hi Sigurd,

Thank you for sharing your knowledge to the community.

@Koen,

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.

Regards,
Google Logo
Teejay Wennie Pimentel
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2NUIUQ:ref
Reply all
Reply to author
Forward
0 new messages