JavaScript: excludedHostnames causing issues with Google Tag Manager?
Joacim Boive
Posted on
Apr 15 2015
Hi!
I'm getting an error in your script file with the current configuration:
<script type="text/javascript" src="//cdn.raygun.io/raygun4js/raygun.min.js"></script>
Raygun.init('API-KEY',{
allowInsecureSubmissions: true,
ignoreAjaxAbort: true,
ignoreAjaxError: false,
debugMode: true,
ignore3rdPartyErrors: true,
wrapAsynchronousCallbacks: true,
**excludedHostnames: ['localhost']**
});
It's the last line that's causing it:
if (W instanceof Array)
for (var h in W)
if (e.location.hostname && e.location.hostname.match(W[h]))
Because h = 'last' for some reason and W['last'] doesn't exist of course.
Should excludedHostnames = 'localhost' instead? Because it's an array with just one entry?
The cause of the error is Google Tag Manager, if I look in the stack trace. Running Chrome 41.
i (raygun.min.js:formatted:39)
u (raygun.min.js:formatted:55) Lc (gtm.js?id=GTM-N…formatted:1344) Nc (gtm.js?id=GTM-N…formatted:1383) Aa (gtm.js?id=GTM-N…:formatted:115) Rd (gtm.js?id=GTM-N…formatted:1747) wb (gtm.js?id=GTM-N…formatted:2131) Gb (gtm.js?id=GTM-N…:formatted:576) a.push (gtm.js?id=GTM-N…formatted:2161) (anonymous function) (gtm.js?id=GTM-N…formatted:2150) Ka (gtm.js?id=GTM-N…:formatted:215) (anonymous function) (gtm.js?id=GTM-N…formatted:2167) (anonymous function) (gtm.js?id=GTM-N…formatted:2185)
Thanks!
/J
Alex
Posted on
Apr 15 2015
Hi Joacim,
The latest release of our JavaScript Provider should resolve this issue. It's available here: https://cdn.raygun.io/raygun4js/1.18.2/raygun.min.js
Best regards, Alex
Joacim Boive
Posted on
Apr 15 2015
I'll try that - thanks!
/J