Javascript – Add Google Analytics to Github wiki pages

githubgoogle analyticsjavascript

I have a couple of Github projects that I want to be able to track the traffic to. I have done this in the past by adding Google Analytics tracking code to each wiki page. However, the Github wiki upgrade in September broke this and I don't seem to be able to add Javascript code to my wiki pages anymore.

A couple of random other points:
1) I'm aware that Github probably blocked JS on the wiki for security reasons.
2) I know Github provides its own very basic traffic graph but I would like all the power of GA.

Is there any way for me to restore Google Analytics tracking to my Github wiki? If not, is there an alternative?

Best Answer

You could leverage the Google Analytics for Mobile strategy.

The draw backs are that :

  • You would only be able to manually publish static image urls in for each wiki page.
  • You would need to host the Google Analytics for Mobile server-side file on another server. Somewhat negating the whole exercise.