Code Monkey home page Code Monkey logo

Comments (9)

jpivarski avatar jpivarski commented on July 19, 2024 3

It looks like you could use this Sphinx extension: sphinx-plausible.

I also looked up "Google Analytics in Sphinx" and found this, since it's a matter of adding a <script> tag in either case.

I don't know that it needs to be in the <head>. In Awkward Array's documentation, it is in the <head>, but the Javascript would run if it were in the <body> as well; it would just start later (which might even be preferable, from a page load speed perspective).

from scikit-hep.github.io.

jpivarski avatar jpivarski commented on July 19, 2024 1

:bump: I highly recommend this, because if you want the data later, you'll have to have set it up earlier.

Here's what the output looks like for Awkward Array's documentation:

We learn, for instance, that there's a strong weekday/weekend effect—people who are working—that the documentation is being read primarily in the United States (odd... is there a U.S./Europe split on Awkward Array? something to look into...),1 that most users are accessing it with Windows—also a surprise, since most of the physicists I know have Macs—that they get to the documentation by direct searches (good; it's intentional), an average bounce rate, and that most people are going into the User Guide, not the Reference, which is much more complete. At the very least, we'll perhaps need to fill our our blank User Guide pages with pointers to the Reference, since that's where people are looking.

Footnotes

  1. No: I should be comparing the U.S. to the sum of European countries, maybe with special attention to Switzerland. The absolute numbers should be weighted by estimated physicists-per-country...

from scikit-hep.github.io.

HDembinski avatar HDembinski commented on July 19, 2024 1

The scikit-hep.org data domain has already been created in Plausible and is waiting for data. The easiest way to get it on all of the Scikit-HEP pages is to add it to one of the templates, but which one depends on how this Jekyll site works. Maybe _layouts/page.html? Maybe _includes/head.html and _includes/head_custom.html?

@jpivarski I assume this is related to the scikit-hep.org website. Do you also know how I can inject the line
<script defer data-domain="scikit-hep.org" src="https://views.scientific-python.org/js/plausible.js"></script>
into sphinx-generated documentation? I was browsing https://www.sphinx-doc.org/en/master/usage/configuration.html and I could not find an option to customize the website head.

In Markdown, it is possible inject arbitrary html code into the markdown code, but my docs are written in RST and I don't know how to do that in RST.

from scikit-hep.github.io.

eduardo-rodrigues avatar eduardo-rodrigues commented on July 19, 2024

Thanks Jim. Very interesting! I was going to make the comment that Europe is indeed the sum of several. Overall the difference Europo-US is not that large. But I was expecting quite more hits from Switzerland for people posted at CERN; that's unexpected.
Another curiosity is the large number of visitors from the UK and the even reasonably larger number from Germany. Would the latter be thanks to Belle II colleagues?

I have no idea why Windows is so prominent. Is it because several colleagues have Windows laptops or rather desktops in the office. I do but know I am a clear minority around me.

A couple of questions:

  1. You need some special account to access these summaries, I guess? Something others here can do as well? The exercise would be particularly interesting for packages with large visibility such as iminuit (@HDembinski) or pyhf (@matthewfeickert)
  2. You say above that there are templates on the website but I did not see them. Can you point to an example from the site or Ackward Array's? Are you in fact going to add such stats-counters to the org site, by chance?

from scikit-hep.github.io.

HDembinski avatar HDembinski commented on July 19, 2024

Thanks for the ping, this is indeed very interesting. I should try to add that to the iminuit docs.

from scikit-hep.github.io.

jpivarski avatar jpivarski commented on July 19, 2024

@eduardo-rodrigues and @HDembinski, you need to be able to access https://views.scientific-python.org/, and you might need to contact Stéfan van der Walt (webpage, GitHub, Discord: stefanv#0829) for that. I had this conversation with him (last year) on Discord.

We don't need any additional help (beyond accessing the dashboard) for the generic Scikit-HEP pages; we just need to get this text into the HTML of all the pages:

<script defer data-domain="scikit-hep.org" src="https://views.scientific-python.org/js/plausible.js"></script>

The scikit-hep.org data domain has already been created in Plausible and is waiting for data. The easiest way to get it on all of the Scikit-HEP pages is to add it to one of the templates, but which one depends on how this Jekyll site works. Maybe _layouts/page.html? Maybe _includes/head.html and _includes/head_custom.html?

Since iminuit has a large community apart from Scikit-HEP (not disjoint, but another large cluster), I think you'll want a specialized iminuit (iminuit.readthedocs.io?) data domain, since each of these data domains is a separate bucket for aggregating statistics and I think you'll want to see iminuit statistics separately from Scikit-HEP statistics (just as we do for Awkward). That would be another thing to ask Stéfan.

from scikit-hep.github.io.

matthewfeickert avatar matthewfeickert commented on July 19, 2024

@jpivarski while I'm going to try to use sphinx-plausible can you link to the PR that you used for Awkward?

from scikit-hep.github.io.

matthewfeickert avatar matthewfeickert commented on July 19, 2024

It doesn't matter where on the page it appears (see a long conversation I had with myself here: scikit-hep/awkward#1819), and I think the defer could be replaced by async

Woops never mind. This is scikit-hep/awkward#1822.

from scikit-hep.github.io.

matthewfeickert avatar matthewfeickert commented on July 19, 2024

pyhf is now reporting at: https://views.scientific-python.org/pyhf.readthedocs.io/

from scikit-hep.github.io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.