A code snippet for tracking page views with Google Analytics on your website

If you use GA, you can try this minimal tracking code snippet to help bring the extra page weight from 75kb down to just 1.5kb.

I’ve been using (the self-installed) ‘On-Premise’ Matomo for a while. (I like the pain of doing something new live and always looking to reduce my dependence on Google.) Matamo is a good replacement for Google Analytics if you’re after simple site analytics. It even works on shared hosting, but it can be quite slow.