Add Google Analytics?
mdhaber opened this issue ยท 23 comments
One way of measuring impact and which functions are used frequently would be via website traffic. I'd be interested in setting up Google Analytics in order to collect that data. Based on this estimate of the number of hits scipy.org gets per month (~3 million), we wouldn't exceed the traffic limit for Google Analytics free version (10 million hit/month). Setup just requires adding the same snippet of code to the <head>
of every page we want to track.
- Shall I give this a shot?
- Would the right place to add the code to this repo be an
extrahead
block inlayout.html
? - Should this be added to scipy-sphinx-theme, too? Would adding the code directly to the
<head>
section of itslayout.html
make the code appear on every page?
Better analytics would be useful, and Google Analytics seems fine (I have no experience with it though).
Re free limit, I think we're at that limit already. From your link: Every user interaction can be sent to Analytics as an individual hit, including (but not limited to) each pageview, screenview, event, and ecommerce transaction. As a result, a single session can result in many hits. SimilarWeb says 2.6 page visits per visitor. Also our user base is still growing fast, so numbers should go up further.
which functions are used frequently
I suspect this is much easier to do via code analysis (e.g. https://github.com/Quansight-Labs/python-api-inspect).
Google Analytics should probably be used at a higher level, like which scipy.org top-level pages are important, or tutorials vs refguide usage.
This might have also a backlash though since most people don't want to be tracked and use adblockers and antitrackers (including myself).
I don't have a strong opinion but google analytics seems like an overkill if just need a pagehit count.
Is scipy.org behind a service like cloudfare? I would imagine they can give basic page view statistics already.
No it's not, and even if it were it'd be hard to get access to it (cause Enthought-owned).
During the NumFOCUS meeting today, MDAnalysis mentioned that they moved away from Google Analytics and use https://www.goatcounter.com/
Nice idea. The 100k/month page views isn't nearly enough though.
$30/mo gets up to 1 million.
https://simpleanalytics.com/
https://plausible.io/
are other suggestions.
So these wouldn't be free, but perhaps it is a reasonable use of some Tidelift money?
Someone also suggested https://github.com/mikecao/umami if $ is a problem, but it would probably be trickier than the others given indirect access to our server.
I would rather not bother if it's not free and very easy to admin. $$ is better spent on developing a decent website, the current https://scipy.org/ and https://scipy.org/scipylib/index.html are pretty terrible.
We should probably end up with a site like NumPy's - and not built on Sphinx.
I won't push much, but wouldn't one month of Tidelift pay for several years at $30/mo? (In fact, once interest rates recover, couldn't a month of Tidelift endow analytics in perpetuity?) A better website is more important, but they're not mutually exclusive.
1 million hits/mo might not quite be enough, so it might cost a bit more than $30/mo - but maybe not much more. Since the numpy.org revamp, our traffic has declined quite a bit. From similarweb:
Also, analytics would help us make our case when we apply for other money. And it might be helpful to know how the website is used now to design a better site.
I won't push much, but wouldn't one month of Tidelift pay for several years at $30/mo? (In fact, once interest rates recover, couldn't a month of Tidelift endow analytics in perpetuity?) A better website is more important, but they're not mutually exclusive.
Could you make this proposal on the core dev list, with what it would actually cost? That's where we decide on spending $$.
Also, analytics would help us make our case when we apply for other money.
Yes, a number like that is useful for proposals. Although a typical total estimate like 1.5M/month would be all you need, so similarweb may be enough.
And it might be helpful to know how the website is used now to design a better site.
The current site is so bad and has so little useful content that I don't think this will help much.
Since scientific-python/scientific-python-hugo-theme#89, we can ask to get added to the Scientific-Python project. Would this be ok @rgommers?
Sounds like a good idea to me!
@stefanv is this the Scientific-Python url that we have to use (that's my reading of the doc)? If yes I can make a quick PR ๐
Yeap, your PR #435 does the right thing! I've enabled scipy.org on our plausible install.
Do we want to have this for the documentation website? Which was the original idea of the issue.
Yes, please, I think. I'm not sure what data you get, but I was hoping to be able to see numbers for documentation of functions/classes so we can get a sense of what is being used.
This is what we get, no more but still valuable ๐
@stefanv if we want to add it to the documentation itself, I just need to copy the JS script line right? Can we add this to the same dashboard (using the same domain in the config) or we need another one? Like can we do the following?
<script defer data-domain="scipy.org" src="https://analytics.scientific-python.org/js/plausible.js"></script>
@tupui I don't think that will work, since the domains will be mis-matched. I've added docs.scipy.org
as a separate data-domain. Once it starts tracking, I can add you as admin.
Also, it looks like we'll be able to "roll up" those stats into one dashboard: plausible/analytics#160 (comment)
@tupui It looks like you can use the same data-domain for both sites, it's just that the URLs will be combined: https://plausible.io/docs/plausible-script#can-i-use-the-same-snippet-across-my-domain-and-subdomain
The "rollup" mentioned above means you can track the sites separately and together, or together, or only separately. Let me know which option you prefer.
After reading this, I would say we start separately and if we need to combine things we can always add another domain to use the rollout method.
I will make a PR.
Great, then you should be all set.