LiveSource
LiveSource

Reputation: 6409

Is it possible to track views and clones of my github repositories

Just wondering if there is any Analytics type things available for github. I'd be curious to know who is viewing / using my code, if anyone...

Upvotes: 27

Views: 21893

Answers (4)

ishandutta2007
ishandutta2007

Reputation: 18194

You would get all the tracking info under insights tabs > traffic subtab(on left). The url should look like this: https://github.com/<username>/<reponame>/graphs/traffic and plots should look like these: enter image description here enter image description here enter image description here

PS: link to the example repo

Upvotes: 0

Dr. Jan-Philip Gehrcke
Dr. Jan-Philip Gehrcke

Reputation: 35741

(disclaimer: I started building this)

https://github.com/jgehrcke/github-repo-stats is a GitHub Action that periodically queries data about total/unique views, total/unique clones (and more, such as stargazers, forks, ...) from the GitHub HTTP API. It persists the data, and generates an HTML report with various charts. The report is also generated as a PDF doc (with vector graphics! : ))

A screenshot of a part of the report: https://i.sstatic.net/xmbbo.png

A demo report is linked in the main README at https://github.com/jgehrcke/github-repo-stats.

enter image description here

Upvotes: 0

VonC
VonC

Reputation: 1324258

Update August 2014:

The Traffic graph now includes the number of clones: See "Clone Graphs"

https://cloud.githubusercontent.com/assets/395621/3867646/2c340b8a-2009-11e4-8823-9ddda44b51e0.png

The 2020 documentation states:

Anyone with push access to a repository can view its traffic, including full clones (not fetches), visitors from the past 14 days, referring sites, and popular content in the traffic graph.


All the information are mainly available through the (newly refurbished) User page.

But you can query some of those data through the Github API for users, as described in "How I built my blog in one day"

I wanted to have a button with my number of GitHub followers and GitHub repositories that was dynamic.
GitHub provides an api of each users information:

jQuery(document).ready(function() {

        $('#gf').text('GitHub Followers');
        $('#gfr').text('GitHub Repos'); 

$.get('https://api.github.com/users/erjjones', function(res) {
var obj = jQuery.parseJSON(res);    
if(typeof obj.followers != 'undefined') 
{   
$('#gf').text(obj.followers + ' GitHub Followers');
$('#gfr').text(obj.public_repos + ' GitHub Repos'); 
}   
    }); 
});

Upvotes: 20

NARKOZ
NARKOZ

Reputation: 27911

All analytics for a GitHub repository is available at

https://github.com/<username>/<reponame>/graphs/traffic

Upvotes: 40

Related Questions