Update Google Analytics code

Use latest tracking blurb straight from Google. Also, the new code
uses "auto" for the domain so we don't need to set that anymore.

Signed-off-by: Alan Orth <alan.orth@gmail.com>
main
Alan Orth 2015-02-06 17:17:40 +03:00
parent 27dba1a192
commit 4b1c26add1
1 changed files with 8 additions and 13 deletions

View File

@ -1,17 +1,12 @@
{% if GOOGLE_ANALYTICS_ID and GOOGLE_ANALYTICS_DOMAIN %}
{% if GOOGLE_ANALYTICS_ID %}
<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');
ga('create', '{{ GOOGLE_ANALYTICS_ID }}', '{{ GOOGLE_ANALYTICS_DOMAIN }}');
(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');
ga('create', '{{ GOOGLE_ANALYTICS_ID }}', 'auto');
ga('send', 'pageview');
</script>
{% endif %}