Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 21st, 2012  |  syntax: None  |  size: 0.82 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <script type="text/javascript">
  2. var _gaq = _gaq || [];
  3. _gaq.push(['_setAccount', 'UA-12345678-1']);
  4. _gaq.push(['_setDomainName', 'yoursite.com']);
  5. _gaq.push(['_addIgnoredRef', 'yoursite.com']);
  6. _gaq.push(['_trackPageview']);
  7.  
  8.  
  9. (function() {
  10.    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  11.    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  12.    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  13. })();
  14.  
  15. // ADD THIS AT THE BOTTOM OF YOUR GOOGLE ANALYTICS TRACKING CODE //
  16. window.onerror = function(message, file, line) {
  17.    var sFormattedMessage = '[' + file + ' (' + line + ')] ' + message;
  18.    _gaq.push(['_trackEvent', 'Exceptions', 'Application', sFormattedMessage, null, true]);
  19. }
  20. </script>