4 ms·
What if your site is a SPA? You would not know, for example, the time spent on site, what pages are visited, where exactly users leave, if there are client-side
by XCSme 6y ago
What if your site is a SPA? You would not know, for example, the time spent on site, what pages are visited, where exactly users leave, if there are client-side errors, right?
- wlll 6y agoThen now you have two problems ;) I guess your options here are, do collect metrics in JS and hope that whatever the reason that 20% of visitors don't show up in Google analytics isn't preventing them from using your site.
- acdha 6y agoIf you're using a SPA you need to build that instrumentation in to match the native behaviour, along with robust error handling using something like https://github.com/getsentry/sentry/ https://github.com/getsentry/sentry/ so you can tell when your code is broken client-side where you would otherwise not have visibility. This is much less likely to be blocked if you self-host it — breaking requests to your server will break the app, whereas blocking common cross-site tracking services is popular because there are few drawbacks for the user.
- XCSme 6y agoYou can self-host sentry?
- acdha 6y agoYes – it's pretty easy to run the open source app in your favorite container runtime: https://hub.docker.com/_/sentry/ https://hub.docker.com/_/sentry/
- XCSme 6y agoWow, I didn't know that. I remember using it at my last company and we always kept receiving quota warnings, and their higher plans were really expensive.
- igneo676 6y agoUse a hybrid approach: 1. Server side analytics 2. Client side analytics for information akin to what you're asking that Server side misses 3. Crash analytics for client side errors As mentioned though, you're only getting partial info from some of those options. It also gives you a chance to decide which of these you _really_ need and hopefully eliminate anything you don't