> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/stormkit-io/stormkit-io/llms.txt
> Use this file to discover all available pages before exploring further.

# Web Analytics

> Simple, privacy-friendly, automatic setup and powerful analytics for web teams.

## Overview

Stormkit's Analytics feature empowers users to gain valuable insights into their web applications. The analytics are completely server-side, privacy-friendly, and require no client-side configuration.

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/stormkit-io-stormkit-io/assets/docs/features/analytics.png" alt="Web Analytics dashboard showing visitor stats and top paths" />
</Frame>

## Enabling Analytics

To enable Analytics, you must set up a custom domain for your web application. This ensures accurate tracking of analytics data.

<Steps>
  <Step title="Navigate to Custom Domains">
    Visit your **Environment** > **Config** > **Other** > **Custom Domains**
  </Step>

  <Step title="Add a custom domain">
    Configure at least one custom domain for your environment.
  </Step>

  <Step title="Analytics automatically enabled">
    Once your custom domain is verified, analytics will be automatically collected for all traffic.
  </Step>
</Steps>

## Privacy-Friendly Collection

All stats are collected on the server-side, which makes this privacy friendly. We collect the following data:

* Visitor IP (used for unique visitor counting, not stored long-term)
* Timestamp
* Request path
* Referrer
* Response code
* User Agent

<Note>
  There are absolutely no cookies stored on the client machine. This means your analytics comply with privacy regulations without requiring cookie consent banners.
</Note>

## Analytics Features

<CardGroup cols={2}>
  <Card title="Unique vs Total Visitors" icon="users">
    Track both unique and total visitors over time. Click on the legend to toggle between views.
  </Card>

  <Card title="Time Spans" icon="clock">
    Change the time span to 24 hours, 7 days, or 30 days to analyze different periods.
  </Card>

  <Card title="Top Referrers" icon="arrow-up-right-from-square">
    View the list of top referrers in the last 30 days to understand where your traffic comes from.
  </Card>

  <Card title="Top Paths" icon="route">
    View the most visited paths in the last 30 days. Client-side routing is excluded from these statistics.
  </Card>
</CardGroup>

## Unique vs Total Visitors

By default, Stormkit loads both unique and total visitors on the Visitors panel.

* **Unique visitors** - Counted once per IP address within the time period
* **Total visitors** - Every page view is counted

To view only unique or total visitors, click on the related legend to toggle the display.

<Info>
  We automatically detect bots from user agents and exclude them from the statistics, ensuring accurate human traffic data.
</Info>

## Top Referrers

The Top Referrers section shows where your visitors are coming from:

* Direct traffic (no referrer)
* Social media platforms
* Search engines
* Other websites linking to you

<Note>
  Depending on the `Referrer-Policy` header set, we may display the full URL or only the domain name.
</Note>

## Top Paths

The Top Paths section displays the most visited pages on your site:

* Landing pages
* Popular content
* Entry points

<Warning>
  Client-side routing is excluded from these statistics. Only server-side requests are tracked.
</Warning>

## Response Codes

Monitor the HTTP response codes to track:

* Successful requests (2xx)
* Redirects (3xx)
* Client errors (4xx)
* Server errors (5xx)

This helps you identify and fix broken links or server issues quickly.
