When I first set up my Github pages Octopress blog I followed those instructions to set Google Analytics tracking up – and it worked. However, in May Google Analytics somehow decided to move my account to Universal Analytics – maybe I had approved it without really knowing what it meant…
Well, what is Universal Analytics? I have no idea! The important thing to notice is, though, that you need to change your JavaScript tracking code if you make that transition; obviously, I didn’t know that. Otherwise tracking wouldn’t work any longer; would it? As a matter of fact, it somehow did.
It is not only not right, it is not even wrong.
Actually, my Analytics dashboard did show some visits and hits, that’s why I didn’t notice the problem for a long time, however, I guess it only mentioned 10% of them! Anyway, after a long debugging session with Google Tag Assistant and Google Analytics Debugger I figured out the necessity to change the code, finally.
Shortly, you just need to change your
source/_includes/google_analytics.html
to this code:
1 2 3 4 5 6 7 8 9 10 11 |
|
Concerning Github pages, it’s not necessary to include a call to set your domain to github.io any longer. It just works out of the box – what a progress! It is not only right, it is not even wrong now!