Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

track install_github() installs? #1729

Closed
cklunch opened this issue Mar 5, 2018 · 14 comments
Closed

track install_github() installs? #1729

cklunch opened this issue Mar 5, 2018 · 14 comments
Labels
feature a feature request or enhancement
Milestone

Comments

@cklunch
Copy link

cklunch commented Mar 5, 2018

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!

@jimhester
Copy link
Member

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).

@jimhester jimhester added the feature a feature request or enhancement label Mar 9, 2018
@cklunch
Copy link
Author

cklunch commented Mar 9, 2018

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.

@dracodoc
Copy link

dracodoc commented Mar 13, 2018

@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.

@jimhester
Copy link
Member

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

@dracodoc
Copy link

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

@llrs
Copy link

llrs commented Jul 17, 2018

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

PS:

What would be your opinion on #rstats devtools tracking package installations for github (and other) remotes?

They would be anonymized download counts per package and could be disabled by setting an environment variable. (Suggested by https://t.co/02U9crxbsm)

— Jim Hester (@jimhester_) 17 de julio de 2018

@MarkEdmondson1234
Copy link

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")

@jimhester
Copy link
Member

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

@jimhester jimhester added this to the backlog milestone Jul 18, 2018
@jimhester
Copy link
Member

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

@bakaburg1
Copy link

bakaburg1 commented Jan 27, 2021

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)

@dracodoc
Copy link

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.

@MarkEdmondson1234
Copy link

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

@jimhester
Copy link
Member

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.

@jimhester
Copy link
Member

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

@r-lib r-lib locked as resolved and limited conversation to collaborators Jan 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

6 participants