Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save peteristhegreat/c900c6db97779c13f33132e90b51a439 to your computer and use it in GitHub Desktop.

Select an option

Save peteristhegreat/c900c6db97779c13f33132e90b51a439 to your computer and use it in GitHub Desktop.
Analytics for Websites, Error Boundaries

Analytics for Websites

I have dug into this topic a few different times over the years.

https://en.wikipedia.org/wiki/StatCounter

Initially I went with StatCounter. I liked how it could show visitor paths and the map of where people were coming from. I also liked seeing the size of the screens they were viewing from and what browsers they were using. The free tier has the last 500 or 2000 interactions.

I set it up on a bunch of Wordpress sites and other places.

https://en.wikipedia.org/wiki/Matomo_(software)

Then I looked into Piwik, since I was into self-hosting just about everything and it sounded straightforward.

PHP + MySQL and I had my own analytics box.

They rebranded to Matomo a while ago.

At another place I worked they had their own branded internal tool "Patriot". It didn't have all the features I wanted.

Eye Tracking, Mouse Tracking, Javascript Event Tracking

What about sub page interactions and tracking? I haven't delved into it, even though I worked for an eye tracking company for a while.

GA, Google Analytics

https://en.wikipedia.org/wiki/Google_Analytics

The reigning champion, GA. Their trackers litter the internet on many sites and they have a huge suite of tools. I haven't dived deep into them but they can do just about everything.

Firebase, Analytics

https://firebase.google.com/docs/analytics/

I've nearly turned this on a few times and since getting purchased by google, this is effectively, just enabling Google Analytics and more by default into the Firebase app from my understanding.

Sentry.io

https://www.reddit.com/r/learnprogramming/comments/ebiqlb/what_does_sentryio_do_exactly/

What about crashes and clientside javascript errors? Error boundaries and catch these and you can see what is going on.

Sentry.io has a pretty generous free tier and great support for a lot of modern frameworks.

I've rolled by own in the past where I just make a dedicated api route for logging errors, and when an error gets caught in the JS on the frontend, it captures the stackframe and sends it over to the api side quickly. This works well in an airgapped setup.

Mobile Browsers and trying to inspect them

Sentry.io is fantastic for helping in this case. When something doesn't work in a iPhone or iPad using your app and you are testing on Android and it is hard to see what in the world is happening... This helps. Otherwise run a copy of Safari on your dev machine and check once in a while.

My claim to fame

https://www.npmjs.com/package/statcounter

https://statcounter.com/react/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment