Devtools: track install_github() installs?

Created on 5 Mar 2018  路  14Comments  路  Source: r-lib/devtools

Is it possible to monitor or count the number of times a package has been installed via install_github()? I'm looking for equivalent numbers to the CRAN logs, but for packages that are only on GitHub. Thanks!

feature

Most helpful comment

The only way to do this would be to have devtools send a anonymized tracking request to something like google analytics, like what is done with homebrew by default.

We have so far avoided doing this due to privacy concerns, but if there was community support for it we could add it to devtools (with the ability to opt out).

All 14 comments

The only way to do this would be to have devtools send a anonymized tracking request to something like google analytics, like what is done with homebrew by default.

We have so far avoided doing this due to privacy concerns, but if there was community support for it we could add it to devtools (with the ability to opt out).

Thanks for the reply! It's good to know it's at least possible. I think this would be a really useful addition to the package, if the community is comfortable with it.

@cklunch @jimhester
~I think you can use the tar.gz download count from github API for this, since install_github always use github api to download the tar.gz first. Something like this.~

See related discussion here.

~This can be done totally in your side (nothing relate to devtools). You probably can use the gh package.~

UPDATE: the answer of using Package Download API no longer works, see expanded comments under that answer. You need to use release API, which may only works if you made releases explicitly.

That only works for releases, typically when people use install_github() they are installing the current master, not a release.

Yes I realized that and edited my post. I probably should edit again to make it more obvious to avoid confusions.

How would it handle reinstalling a package from the same IP? Who would store the data? How would it handle the GDPR law?

PS:

There would be no concern for GDPR if no ID is stored that can be linked back to a user (I've done GDPR audits for web analytics past few months)

I've wondered about doing this myself for tracking package installs, which I suggest if using Google Analytics would be best done by a measurement protocol hit that I've wrapped in https://github.com/MarkEdmondson1234/googleMeasureR - if its a random cid (cookieID) and anonymise ip you would just get aggregated metrics. Lots of similar services out there that work via a API hit. I would favour an opt-in though upon installation. ("I agree to give anonymous statistics to help the developers etc. etc")

Thanks @MarkEdmondson1234, that is useful information. homebrew's analytics is a useful model for this and I believe they use that same GA protocol.

This seems unlikely to happen due to CRAN policy / likely community pushback.

Hello, I know that the issue is closed (even if I didn't understand the CRAN policy problem), but I was wondering if it's possible to check the downloads via github directly, without any action from the R side. Is there any github action or API that can be used for this? Using https://img.shields.io/github/downloads/User/Repo/total.svg doesn't work because it checks only releases downloads.
What actions is actually devtools performing when installing from github? (I tried to check install_github code, but it's very nested and got lost)

As said before probably only releases download can be checked.

devtools code about installing were organized in remotes, you can read it there. I think it just download the source zip from github.

@bakaburg1 In GitHub settings you can see the Insights tabs which tracks the number of clones that I guess correspond to install_github() installs (?)

install_github() does not clone the repository, it downloads the tar.gz, which GitHub does not track. If there was a way to track this through GitHub we would be doing it.

As this is quite an old issue I am going to lock it, thank you all for the feedback!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stulacy picture stulacy  路  13Comments

ncdingari picture ncdingari  路  10Comments

jadahlke picture jadahlke  路  19Comments

hongooi73 picture hongooi73  路  12Comments

wch picture wch  路  11Comments