peterdesmet / petridish

Jekyll theme for research project websites 🧫
https://peterdesmet.github.io/petridish
MIT License
49 stars 44 forks source link

Add Plausible analytics #83

Open peterdesmet opened 1 year ago

peterdesmet commented 1 year ago

Plausible is a cookie-free, GDPR-compliant visit stats tracking: https://plausible.io/, used e.g. by GBIF: https://plausible.io/gbif.org

jocelynpender commented 1 year ago

I definitely upvote this. Is there a way to integrate Google Analytics currently?

peterdesmet commented 1 year ago

To enable Google Analytics (GA), you can add your own _includes/footer.html (overwriting the default) that includes the GA JavaScript code.

Although I'd prefer Plausible over GA, I'm a bit reluctant to directly support it in Petridish, since it is a service you have to pay for (all other services Petridish relies on are free).

Another option is to provide a custom.js in Petridish, which users can then overwrite with whatever code they want (without having to change the footer.html). Something similar is already supported for adding custom CSS by adding a _sass/custom.scss.

Thoughts?

niconoe commented 1 year ago

I like having the flexibility of having customizable js/footer files (not sure which one is best), rather than support for a specific product.

But if you add a bit of documentation (examples) about how to use the "custom features" to implement GA and Plausible, I think we're not far from having the best of both worlds.