mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-06 03:13:42 -05:00
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`.
23 lines
385 B
JavaScript
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);
|