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 disqus_shortname: blog-kempkens-io
#Your site's domain goes here. Leave localhost server or blank when working locally. #Your site's domain goes here. Leave localhost server or blank when working locally.
url: http://blog.kempkens.io url: http://blog.kempkens.io
source_url: https://github.com/nifoc/blog.kempkens.io
# Owner/author information # Owner/author information
owner: owner:
@ -28,7 +29,11 @@ background:
# Analytics and webmaster tools stuff goes here # Analytics and webmaster tools stuff goes here
google_analytics: UA-28082386-3 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: google_verify:
# https://ssl.bing.com/webmaster/configure/verify/ownership Option 2 content= goes here # https://ssl.bing.com/webmaster/configure/verify/ownership Option 2 content= goes here
bing_verify: bing_verify:

View file

@ -1,4 +1,4 @@
<span> <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 /> &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>.
<a href="https://github.com/nifoc/blog.kempkens.io">Source on GitHub</a> {% if site.source_url %}<br /><a href="{{ site.source_url }}">Source on GitHub</a>{% endif %}
</span> </span>

View file

@ -9,8 +9,21 @@
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 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'); })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', '{{ site.google_analytics }}', '{{ site.google_analytics_site }}'); (function() {
ga('send', 'pageview'); 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> </script>
{% endif %} {% endif %}
{% if page.comments %}{% include disqus_comments.html %}{% endif %} {% if page.comments %}{% include disqus_comments.html %}{% endif %}