mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-10 05:14:05 -05:00
We’re interested to know which services are looking at the basic view preview (even if they’re not turning it on). This commit logs their service IDs as events into Google Analytics.
33 lines
589 B
JavaScript
33 lines
589 B
JavaScript
(function(Modules) {
|
|
"use strict";
|
|
|
|
if (!ga) return;
|
|
|
|
function sendEvent(category, action, label) {
|
|
|
|
ga('send', 'event', category, action, label);
|
|
|
|
}
|
|
|
|
Modules.TrackError = function() {
|
|
|
|
this.start = component => sendEvent(
|
|
'Error',
|
|
$(component).data('error-type'),
|
|
$(component).data('error-label')
|
|
);
|
|
|
|
};
|
|
|
|
Modules.TrackEvent = function() {
|
|
|
|
this.start = component => sendEvent(
|
|
$(component).data('event-category'),
|
|
$(component).data('event-action'),
|
|
$(component).data('event-label')
|
|
);
|
|
|
|
};
|
|
|
|
})(window.GOVUK.Modules);
|