Reputation: 311
I like to add google analytics on my github respository. So i can keep track of user visit.
Upvotes: 31
Views: 14971
Reputation: 61
The Segment tracking pixel works great for this. Just embed that in your README/other files and you can record anonymous page hits to your repo.
Upvotes: 4
Reputation: 3396
I made a web app to record repo traffic, stars and other analytics data of github repos.
Upvotes: 5
Reputation: 79754
With ga-beacon you should be able to do minimal Google Analytics tracking on your GH repo. You won't be able to track to the level of detail that GH's own analytics does, but you should at least be able to track visits to your main repo page, for instance.
Upvotes: 9
Reputation: 349
Unfortunately, you cannot use Google Analytics to monitor your GitHub repository page because you simply do not own the page. GitHub offers their own traffic analytics platform.
I have not verified this myself, but you if you have a GitHub Pages site at <your GitHub username>.github.io
(or a specific project page using GitHub Pages), you could add Google Analytics to that site. It won't necessarily capture visits to the specific repository page, but it could help, especially if you have a particularly active GitHub Pages website.
See this related post for more info: How to add Google Analytics Tracking ID to GitHub Pages
Upvotes: 16