mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-12 14:34:05 -05:00
Remove UUIDs from URLs sent to Google Analytics
If all our URLs are unique (because they contain service/job/template IDs) then it makes it hard to aggrate how users are behaving across a range of services/jobs/templates. This commit replaces anything that looks like a UUID in a URL with `…`.
This commit is contained in:
@@ -135,6 +135,10 @@
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
ga('create', 'UA-75215134-1', 'auto');
|
||||
ga('send', 'pageview');
|
||||
// strip UUIDs
|
||||
page = window.location.href.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>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user