Skip to content

Instantly share code, notes, and snippets.

@hfcorriez
Last active December 14, 2018 09:01
Show Gist options
  • Save hfcorriez/624956144555860830d3af21e4fc1a68 to your computer and use it in GitHub Desktop.
Save hfcorriez/624956144555860830d3af21e4fc1a68 to your computer and use it in GitHub Desktop.
Load raven js async (ga.js like)
!function(n,e,a,t,o,r,s,c){var c=c||[];n.onerror=function(n,e,a){c.push([n,e,a])};var i=!1;
r=e.createElement(a),s=e.getElementsByTagName(a)[0],r.async=1,r.src=t,r.crossorigin="anonymous",
r.onreadystatechange=r.onload=function(){if(!i){Raven.config(o).install();for(var n=0;n<c.length;n++)Raven.captureMessage("Message: "+c[n][0]+" - URL: "+c[n][1]+" - Line: "+c[n][2])}i=!0}
,s.parentNode.insertBefore(r,s)
}(window,document,"script","https://cdn.ravenjs.com/3.16.0/raven.min.js","https://xx@sentry.io/xx");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment