Skip to content

Commit

Permalink
Remove UUIDs from URLs sent to Google Analytics
Browse files Browse the repository at this point in the history
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 `…`.
  • Loading branch information
quis committed Oct 5, 2016
1 parent e095d60 commit 4ea7d80
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/templates/admin_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ <h2>API documentation</h2>
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 %}

0 comments on commit 4ea7d80

Please sign in to comment.