OGGM / oggm-edu

Educational material about glaciers, powered by OGGM and MyBinder
http://edu.oggm.org
BSD 3-Clause "New" or "Revised" License
22 stars 28 forks source link

Add analytics to the bokeh apps #195

Open fmaussion opened 1 week ago

fmaussion commented 1 week ago

Each of the bokeh apps should add the following html snippet to their header. There is probably a way to do it in panel before or during html export, but worst case a quick python postprcessing script could open the html file and add the line just before the </head> tag.

<script defer data-domain="bokeh.oggm.org" src="https://plausible.oggm.org/js/script.js"></script>

While we are at it, it would be good to update them to newer versions of bokeh / panel and see if it still works, and I would be thankful for the Bristol logo 🙈 :

@pat-schmitt when you have some time to spare... (not super urgent)

TimoRoth commented 1 week ago

I don't think there is an html file, the pages are generated on the fly, and also completely generated via JavaScript on the fly. There is practically no hard written HTML anywhere, so this is actually rather complicated. A quick google also shows no native way to just add a script tag, but only one to directly execute JavaScript, which isn't suitable to add a script like this.

fmaussion commented 1 week ago

Ah yes I forgot that we serve apps like this... In the notebook there is the possibility to export to html, but we do this differently...

fmaussion commented 1 week ago

There is this: https://discourse.bokeh.org/t/how-to-integrate-matomo-something-like-google-analytics/6369/7

But it looks a bit complicated indeed