Files
notifications-admin/app/assets/javascripts/errorTracking.js
Tom Byers b6e37a6ac8 Add event tracking to window.GOVUK.analytics
app/assets/javascripts/errorTracking.js sent
events to `window.ga`.

This extends the API of `window.GOVUK.Analytics`
to include support for sending events so all
calls to `window.ga` can use it instead of direct
access.

This use of `window.ga` was missed from the
initial work on `window.GOVUK.Anaytics`.
2020-01-14 11:28:06 +00:00

23 lines
385 B
JavaScript

(function(window) {
"use strict";
window.GOVUK.Modules.TrackError = function() {
this.start = function(component) {
if (!('analytics' in window.GOVUK)) return;
window.GOVUK.analytics.trackEvent(
'Error',
$(component).data('error-type'),
{
'label': $(component).data('error-label')
}
);
};
};
})(window);