Created
January 31, 2018 04:10
-
-
Save yuriygr/af40cabbdac98138ac33541ab4d8f289 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script> | |
| if (typeof window.onerror == "object") { | |
| window.onerror = function (msg, url, line, col, error) { | |
| if (typeof(msg) === 'object' && msg.srcElement && msg.target) { | |
| if (msg.srcElement == '[object HTMLScriptElement]' && msg.target == '[object HTMLScriptElement]') { | |
| msg = 'Error loading script'; | |
| } else { | |
| msg = 'Event Error - target:' + msg.target + ' srcElement:' + msg.srcElement; | |
| } | |
| } | |
| msg = msg.toString(); | |
| ga('send', 'exception', { | |
| 'exDescription': line + "-" + col + " " + msg, | |
| 'exFatal': false | |
| }); | |
| }; | |
| } | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment