JupiterBroadcasting / jupiterbroadcasting.com

JupiterBroadcasting.com, hugo-based and community-driven!
https://jupiterbroadcasting.com
99 stars 48 forks source link

Consider Plausible - open source website analytics #70

Closed gerbrent closed 2 years ago

gerbrent commented 2 years ago

Plausible: Open source Google Analytics alternative | Plausible Analytics

First Question: Do we even want/need analytics?

ironicbadger commented 2 years ago

This is simple enough to do if you still want it. We already have a plausible instance running it would just be a case of injecting the tracking code into the hugo site headers.

<script defer data-domain="new.jupiterbroadcasting.com" src="https://plausible.ktz.cloud/js/plausible.js"></script>

I have a demo instance set up we can use for testing. Above is the code to be injected into <head>.

https://plausible.io/docs/hugo-integration

gerbrent commented 2 years ago

@elreydetoda - can you help Alex implement the into Hugo-speak?

elreydetoda commented 2 years ago

No problem, I can get this implemented after work (17:00 EST).

elreydetoda commented 2 years ago

Alright, I think that PR should work. I made it a bit more dynamic so we could potentially use it for other sites (i.e. jb-live (once we merge the footer/menu into that theme), if we have a dev.jb.com, etc.). So, that's why I'm saying it should work :upside_down_face:

If not we can just pass in the data-domain via the params.toml like how I did for the url.

Also, @ironicbadger is there anyway you could rename the plausible file to something else, because by default the way I getting the file it's keeping the plausible name in the filename. I'm pretty sure I've seen regex before (IIRC in uBlock origin) just based on the word plausible. So, if you change it to something that uBlock doesn't key off of then you'll probably get more analytics data.

This is plausible's recommendation: https://plausible.io/docs/proxy/introduction#are-you-concerned-about-missing-data

ironicbadger commented 2 years ago

Confirmed working! 🥳