Added analytics code.

This commit is contained in:
tjp03u
2015-03-11 14:57:33 +00:00
parent 2568517a8f
commit 2ae6e305e2
2 changed files with 14 additions and 0 deletions

13
templates/analytics.html Normal file
View File

@@ -0,0 +1,13 @@
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
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');
{% if user.is_authenticated %}
ga('create', 'UA-43285686-12', {'userId': '{% user.pk %}'});
{% else %}
ga('create', 'UA-43285686-12');
{% endif %}
ga('send', 'pageview');
</script>