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>
This commit is contained in:
parent
27dba1a192
commit
4b1c26add1
1 changed files with 8 additions and 13 deletions
|
@ -1,17 +1,12 @@
|
||||||
{% if GOOGLE_ANALYTICS_ID and GOOGLE_ANALYTICS_DOMAIN %}
|
{% if GOOGLE_ANALYTICS_ID %}
|
||||||
<script>
|
<script>
|
||||||
(function (i, s, o, g, r, a, m) {
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
i['GoogleAnalyticsObject'] = r;
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
i[r] = i[r] || function () {
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||||
(i[r].q = i[r].q || []).push(arguments)
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||||
}, i[r].l = 1 * new Date();
|
|
||||||
a = s.createElement(o),
|
ga('create', '{{ GOOGLE_ANALYTICS_ID }}', 'auto');
|
||||||
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 }}');
|
|
||||||
ga('send', 'pageview');
|
ga('send', 'pageview');
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue