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

# Track Site Analytics

> Monitor visitors, page views, and user behavior on your Hiveku site

Hiveku includes a privacy-friendly visitor analytics tool built into every project. No cookie banner required, no separate account, no manual script installation — just flip it on and start seeing traffic.

## Enable Visitor Analytics

<Steps>
  <Step title="Open your project">
    From your [dashboard](https://app.hiveku.com/dashboard), click the site you want to track.
  </Step>

  <Step title="Turn on the integration">
    Go to **Hosting > Integrations** and toggle **Visitor Analytics** on.

    <Info>
      The tracking script is injected automatically at deploy time. You don't need to add anything to your HTML.
    </Info>
  </Step>

  <Step title="Deploy">
    Click **Deploy** in the top bar. The script only attaches on the next build — existing live pages won't track until they're rebuilt.
  </Step>

  <Step title="Open the Analytics tab">
    Back in your project, click **Analytics** in the sidebar. You'll see a dashboard that fills in as visitors arrive.
  </Step>
</Steps>

## What Gets Tracked

* **Page views** — every page load, with path and title
* **Sessions** — grouped visits from the same visitor
* **Referrers** — where visitors came from
* **Devices** — desktop, mobile, tablet breakdown
* **Countries** — based on IP geolocation (not stored)
* **Browsers and operating systems**

Use the **Date range** selector at the top to switch between 24 hours, 7 days, 30 days, 90 days, or a custom range.

### Reports

* **Top Pages** — which URLs are getting traffic
* **Top Referrers** — which sites are sending visitors
* **Browser / Device / Country breakdowns** — audience composition
* **Real-time** — see live visitors currently on your site

<Tip>
  The real-time view is great for launches — refresh it as you share a link and watch traffic arrive.
</Tip>

## Privacy Posture

Hiveku Analytics is designed to be GDPR/CCPA-friendly out of the box:

* No cookies
* No personal data stored
* No cross-site tracking
* IP addresses are used only for geolocation and then discarded

Most regions don't require a cookie banner for this kind of analytics, but check your local regulations.

## Using Google Analytics or Plausible Instead

If you prefer a dedicated analytics tool, you can keep Hiveku Analytics off and add your own.

<Steps>
  <Step title="Add your tracking ID as an env var">
    In **Settings > Environment Variables**, add:

    ```
    NEXT_PUBLIC_GA_ID=G-XXXXXXX
    ```

    or for Plausible:

    ```
    NEXT_PUBLIC_PLAUSIBLE_DOMAIN=yourcompany.com
    ```
  </Step>

  <Step title="Add the script to your layout">
    Ask the AI: *"Add Google Analytics using the `NEXT_PUBLIC_GA_ID` env var"*. It will drop the right snippet into your root layout.
  </Step>

  <Step title="Deploy">
    Click **Deploy**. Traffic will start flowing to the external dashboard.
  </Step>
</Steps>

## Verifying It Works

Visit your live site in a new browser or incognito window. Within a few seconds, you should see the visit show up in **Analytics > Real-time**. If you chose Google Analytics or Plausible, check those dashboards instead.

## Troubleshooting

<AccordionGroup>
  <Accordion title="No data yet — I enabled it but nothing shows up">
    The tracking script attaches at build time. Click **Deploy** again after enabling the integration, then visit your site. Real-time should populate within seconds.
  </Accordion>

  <Accordion title="Ad blockers are blocking my own visits">
    This is expected — uBlock Origin and similar tools block most analytics scripts. Hiveku Analytics tries to look like a first-party request, but dedicated blocklists still catch it. Test from a browser without blockers, or ask a colleague.
  </Accordion>

  <Accordion title="Subdomain traffic isn't tracked">
    If you've attached a custom subdomain via your own CDN, the script may not be injected. Confirm the subdomain is pointed at Hiveku directly (see [/publishing/custom-domains](/publishing/custom-domains)) and redeploy.
  </Accordion>

  <Accordion title="Page view counts look too low">
    Single-page apps (React Router, Next.js App Router) often have client-side navigation that the default script tracks. If you've customized routing, the AI can audit your setup — ask: *"Are my analytics capturing client-side route changes?"*
  </Accordion>
</AccordionGroup>

## What's Next?

<CardGroup cols={2}>
  <Card title="SEO" icon="magnifying-glass" href="/how-tos/seo">
    Pair analytics with SEO to understand which pages convert
  </Card>

  <Card title="Custom Domains" icon="globe" href="/publishing/custom-domains">
    Track traffic on your own domain, not the `.hiveku.com` default
  </Card>
</CardGroup>
