Why Server Side Analytics Provides More Reliable Insights

Just now, 29TB of data has been created. If you read that sentence in one second, that's the volume of information generated (and every second, of every day). Most of the data our computers gather is noise, but finding insights from the data we already have is a powerful way to run a data-driven business.

But when building apps, analytics trackers often get thrown in at the end of development as a quick way to "generate new data." How useful is the data from these trackers, though?

The Problem with Client-Side Analytics

Traditional client-side analytics solutions like Google Analytics run JavaScript code on your browser and might set cookies to operate correctly. This approach faces several significant challenges:

  • Ad blockers and privacy tools increasingly block tracking scripts
  • Cookie consent requirements hide users who don't accept all cookies
  • Reduced page speed loading extra scripts and domain connections

While adding a tracking tag to your site might generate data about your app usage, it isn't a complete picture of your users, guests or site performance.

Why Server-Side Analytics is More Reliable

Instead of measuring the users who chose not to change their browser or extension settings, we can get useful insights from our CDN or web server's access logs. This eliminates the need for client-side JavaScript.

  • Every request is captured, regardless of cookie consent
  • No dependency on client-side JavaScript
  • Consistent data collection across all visitors
  • No third parties using this data for who-knows-what
  • Better page load times and app performance

Finding Insights

Enabling CDN access logs is the first step to getting valuable insights from your app usage. Insights come from grouping IP-Address, User-Agent visitors and following the Path of requests this user makes.

In AWS CloudWatch Log Insights QL, you can try a few queries:

Find the pages users visit the most:

filter @logStream = 'CloudFront_EA123456789EEAA'
| fields `c-ip` as ip, `cs(User-Agent)` as ua, `cs-uri-stem` as path
| stats count(*) as requestCount by ip, ua, path
| sort ip, requestCount

Or find rogue bots hitting your service:

filter @logStream = 'CloudFront_EA123456789EEAA'
| fields @timestamp, `c-ip` as ip, `cs(User-Agent)` as ua, `cs-uri-stem` as path, `x-edge-result-type` as result
| filter path not in ['/robots.txt', '/.well-known/assetlinks.json']
| parse result "Error" as `r-error`
| stats count(`r-error`) as errors, count(*) as requests, latest(`x-forwarded-for`) as fwdfr by ip
| fields errors/requests as pct_error
| filter pct_error > 0.75 and requests > 5

Incorporating Insights into Your Business

Use Retainless to quickly digest these access logs into metrics that your business can use for making data-driven decisions.

Retainless is a sever-side analytics platform for measuring your app's success. Data stays within your cloud account, and you can use the open-source CLI or sign up for Retainless Cloud to see the metrics.

Best of luck!