mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 16:24:08 -04:00
Revert "Track event when someone previews basic view"
This reverts commit 77d96032bf.
This commit is contained in:
@@ -1,56 +0,0 @@
|
|||||||
let stripUUIDs = string => string.replace(
|
|
||||||
/[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}/g, '…'
|
|
||||||
);
|
|
||||||
|
|
||||||
(function(Modules) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
function sendEvent(category, action, label) {
|
|
||||||
|
|
||||||
if (!ga) return;
|
|
||||||
ga('send', 'event', category, action, label);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function sendVirtualPageView(path) {
|
|
||||||
|
|
||||||
if (!ga) return;
|
|
||||||
ga('send', 'pageview', stripUUIDs('/virtual' + path));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
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')
|
|
||||||
);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
Modules.TrackFormSubmission = function() {
|
|
||||||
|
|
||||||
this.start = component => {
|
|
||||||
|
|
||||||
$(component).on('submit', function() {
|
|
||||||
|
|
||||||
let formData = $('input[name!=csrf_token]', this).serialize();
|
|
||||||
sendVirtualPageView(window.location.pathname + '?' + formData);
|
|
||||||
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
})(window.GOVUK.Modules);
|
|
||||||
22
app/assets/javascripts/errorTracking.js
Normal file
22
app/assets/javascripts/errorTracking.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
(function(Modules) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
Modules.TrackError = function() {
|
||||||
|
|
||||||
|
this.start = function(component) {
|
||||||
|
|
||||||
|
if (!ga) return;
|
||||||
|
|
||||||
|
ga(
|
||||||
|
'send',
|
||||||
|
'event',
|
||||||
|
'Error',
|
||||||
|
$(component).data('error-type'),
|
||||||
|
$(component).data('error-label')
|
||||||
|
);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
})(window.GOVUK.Modules);
|
||||||
@@ -128,7 +128,10 @@
|
|||||||
ga('set', 'anonymizeIp', true);
|
ga('set', 'anonymizeIp', true);
|
||||||
ga('set', 'displayFeaturesTask', null);
|
ga('set', 'displayFeaturesTask', null);
|
||||||
ga('set', 'transport', 'beacon');
|
ga('set', 'transport', 'beacon');
|
||||||
page = window.location.pathname + window.location.search;
|
// strip UUIDs
|
||||||
ga('send', 'pageview', stripUUIDs(page));
|
page = (window.location.pathname + window.location.search).replace(
|
||||||
|
/[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}/g, '…'
|
||||||
|
)
|
||||||
|
ga('send', 'pageview', page);
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -9,11 +9,7 @@
|
|||||||
{% block maincolumn_content %}
|
{% block maincolumn_content %}
|
||||||
|
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<form
|
<form method="post" class="column-five-sixths">
|
||||||
method="post"
|
|
||||||
class="column-five-sixths"
|
|
||||||
data-module="track-form-submission"
|
|
||||||
>
|
|
||||||
<h1 class="heading-large">Basic view</h1>
|
<h1 class="heading-large">Basic view</h1>
|
||||||
<p>
|
<p>
|
||||||
Hide the dashboard and other options from team members who only need to send messages.
|
Hide the dashboard and other options from team members who only need to send messages.
|
||||||
|
|||||||
@@ -10,13 +10,7 @@
|
|||||||
<div class="navigation-service-name">
|
<div class="navigation-service-name">
|
||||||
{{ current_service.name }}
|
{{ current_service.name }}
|
||||||
{% if current_user.previewing_basic_view %}
|
{% if current_user.previewing_basic_view %}
|
||||||
<span
|
<span class="navigation-service-basic-view-preview">Preview of basic view</span>
|
||||||
class="navigation-service-basic-view-preview"
|
|
||||||
data-module="track-event"
|
|
||||||
data-event-category="basic-view"
|
|
||||||
data-event-action="preview"
|
|
||||||
data-event-label="{{ current_service.id }}"
|
|
||||||
>Preview of basic view</span>
|
|
||||||
<a class="navigation-service-basic-view-back-link" href="{{ url_for('main.service_set_basic_view', service_id=current_service.id)}}">Back to settings</a>
|
<a class="navigation-service-basic-view-back-link" href="{{ url_for('main.service_set_basic_view', service_id=current_service.id)}}">Back to settings</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ gulp.task('javascripts', () => gulp
|
|||||||
paths.src + 'javascripts/updateContent.js',
|
paths.src + 'javascripts/updateContent.js',
|
||||||
paths.src + 'javascripts/listEntry.js',
|
paths.src + 'javascripts/listEntry.js',
|
||||||
paths.src + 'javascripts/liveSearch.js',
|
paths.src + 'javascripts/liveSearch.js',
|
||||||
paths.src + 'javascripts/analytics.js',
|
paths.src + 'javascripts/errorTracking.js',
|
||||||
paths.src + 'javascripts/preventDuplicateFormSubmissions.js',
|
paths.src + 'javascripts/preventDuplicateFormSubmissions.js',
|
||||||
paths.src + 'javascripts/fullscreenTable.js',
|
paths.src + 'javascripts/fullscreenTable.js',
|
||||||
paths.src + 'javascripts/conditionalRadios.js',
|
paths.src + 'javascripts/conditionalRadios.js',
|
||||||
|
|||||||
Reference in New Issue
Block a user