Sha256: 68bf388907f6d1e3f8cc79185d06f5d18be0086f1a89c396cb64c918bc13b401

Contents?: true

Size: 600 Bytes

Versions: 1

Compression:

Stored size: 600 Bytes

Contents

// Extension to track errors using google analytics as a data store.
(function() {

  "use strict";
  var trackJavaScriptError = function (e) {
    var errorSource = e.filename + ': ' + e.lineno;
    GOVUK.analytics.trackEvent('JavaScript Error', e.message, {
      label: errorSource,
      value: 1,
      nonInteraction: true
    });
  };

  if (window.addEventListener) {
    window.addEventListener('error', trackJavaScriptError, false);
  } else if (window.attachEvent) {
    window.attachEvent('onerror', trackJavaScriptError);
  } else {
    window.onerror = trackJavaScriptError;
  }

}());

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
govuk_frontend_toolkit-3.2.0 app/assets/javascripts/govuk/analytics/error-tracking.js