1
0
Fork 0

Improved GA tracking

This commit is contained in:
Daniel Kempkens 2014-03-25 14:55:33 +01:00
parent 641ea98ba9
commit 962c14691c
3 changed files with 23 additions and 5 deletions

View file

@ -3,6 +3,7 @@ description: '[...] procedure calls may be usefully thought of as GOTO stat
disqus_shortname: blog-kempkens-io
#Your site's domain goes here. Leave localhost server or blank when working locally.
url: http://blog.kempkens.io
source_url: https://github.com/nifoc/blog.kempkens.io
# Owner/author information
owner:
@ -28,7 +29,11 @@ background:
# Analytics and webmaster tools stuff goes here
google_analytics: UA-28082386-3
google_analytics_site: blog.kempkens.io
google_analytics_linker:
'daniel.xxx':
- blog.kempkens.io
'blog.kempkens.io':
- daniel.xxx
google_verify:
# https://ssl.bing.com/webmaster/configure/verify/ownership Option 2 content= goes here
bing_verify:

View file

@ -1,4 +1,4 @@
<span>
&copy; {{ site.time | date: '%Y' }} {{ site.owner.name }}. Powered by <a href="http://jekyllrb.com">Jekyll</a> using the <a href="http://mademistakes.com/hpstr/">HPSTR Theme</a>.<br />
<a href="https://github.com/nifoc/blog.kempkens.io">Source on GitHub</a>
&copy; {{ site.time | date: '%Y' }} {{ site.owner.name }}. Powered by <a href="http://jekyllrb.com">Jekyll</a> using the <a href="http://mademistakes.com/hpstr/">HPSTR Theme</a>.
{% if site.source_url %}<br /><a href="{{ site.source_url }}">Source on GitHub</a>{% endif %}
</span>

View file

@ -9,8 +9,21 @@
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', '{{ site.google_analytics }}', '{{ site.google_analytics_site }}');
ga('send', 'pageview');
(function() {
var linkerOptions = {{ site.google_analytics_linker | jsonify }};
var host = window.location.host;
if (linkerOptions !== null) {
ga('create', '{{ site.google_analytics }}', host, 'auto', {
'allowLinker': true
});
ga('require', 'linker');
ga('linker:autoLink', linkerOptions[host]);
} else {
ga('create', '{{ site.google_analytics }}', host);
}
ga('send', 'pageview');
})();
</script>
{% endif %}
{% if page.comments %}{% include disqus_comments.html %}{% endif %}