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

# Exclude Internal and Unwanted Traffic

> Exclude internal or unwanted traffic by IP, country, path, hostname, user agent, or bot status before it enters your analytics reports.

Exclusions keep unwanted traffic out of your analytics by dropping it **at collection** — so internal tools, staging sites, monitoring bots, and your own visits never reach your reports. You set them per site in your settings. From then on, matching requests are quietly ignored: the visitor still gets a normal response, but nothing is recorded.

The same settings tab also holds **[referrer exclusions](#how-do-i-stop-a-referrer-from-showing-up-as-a-referral)**, which work differently: they keep the visit and reclassify it as Direct.

<Note>
  An **exclusion** is not the same as a [filter](/docs/analytics-filters). An exclusion drops the data before it's ever stored — it can't be recovered later. A filter just changes what a report *shows*; the data is still collected. Use an exclusion for traffic you never want to measure, and a filter to focus a report on traffic you did.
</Note>

## What can I exclude?

You can exclude traffic by IP address, country, path, hostname, or user agent. Configure these in your site's **Exclusions** settings (an owner or admin edits them). Each type matches a different signal, and all five drop the request at collection:

| Exclude by     | Matches                                                        | Examples                        |
| -------------- | -------------------------------------------------------------- | ------------------------------- |
| **IP address** | a single IP, a CIDR block, or a range (IPv4 and IPv6)          | `203.0.113.10`, `10.0.0.0/8`    |
| **Country**    | a two-letter country code                                      | `US`, `DE`                      |
| **Path**       | a path pattern with `*` wildcards (must start with `/` or `*`) | `/admin/*`, `*/preview`         |
| **Hostname**   | a hostname pattern with `*` wildcards                          | `staging.example.com`, `*.test` |
| **User agent** | a **case-insensitive substring** — no wildcards                | `UptimeRobot`, `curl`           |

<Warning>
  Path and hostname use `*` as a wildcard, but **user agent matching is a plain substring** — a `*` in a user-agent entry is treated literally and won't act as a wildcard. Write `curl`, not `curl/*`.
</Warning>

Each list holds up to **100 entries** of up to **256 characters** each. Excluded traffic is dropped invisibly — a matching request gets the same successful response as any other, so there's no way for someone to tell they were excluded.

## How do I stop a referrer from showing up as a Referral?

Add it to **Referrer Exclusions** on the same **Exclusions** tab. Matching visits are reported as **Direct** instead of **Referral** — useful for payment providers, auth portals, and other domains you own, which show up as referrals when a visitor bounces back to your site.

<Warning>
  **Referrer exclusions don't drop traffic.** Unlike the five lists above, the visit is still recorded in full — only its referrer is cleared and its [channel](/docs/resources/analytics-channel-attribution) becomes Direct. This is the one item on the Exclusions tab that keeps your data.
</Warning>

Enter a bare domain like `stripe.com`. A few rules worth knowing:

* **A bare domain also covers its subdomains.** `stripe.com` matches `checkout.stripe.com` too.
* **`*` wildcards are supported**, and an explicit pattern matches exactly what it says — `*.stripe.com` covers the subdomains but *not* bare `stripe.com`.
* **Matching ignores `www.`** and is case-insensitive; entries are stored lowercased.
* **UTM tags still win.** A visit from an excluded referrer that carries [UTM parameters](/docs/resources/analytics-channel-attribution#tag-your-own-links) keeps its UTM-derived channel — only the stored referrer is cleared.

The list holds up to **100 entries** of up to **256 characters** each. It applies to incoming tracked traffic, not to [imported historical data](/docs/migrate-analytics-data-to-tinyanalytics) or [short links](/docs/trackable-short-links).

## Why does my own domain show up as a referral?

Usually it doesn't — tinyanalytics already recognizes hops between your root domain and its subdomains. A visitor moving from `example.com` to `app.example.com`, or back the other way, stays one session and is classified **Internal** rather than counted as a new referral. Own-domain rows also disappear from the Referrers report retroactively, so history cleans up without a backfill.

One case still needs configuring: **hops between two sibling subdomains**, like `app.example.com` to `blog.example.com`. Because they share no parent-child relationship, tinyanalytics treats them as separate sites. Add your root domain (`example.com`) to **Referrer Exclusions** to cover them.

## Does tinyanalytics block bots automatically?

Yes. tinyanalytics filters out bots and crawlers automatically, and the **block-bots** toggle in your site settings controls it. It's **on by default**, so most sites never need to touch it — bot traffic is kept out of your reports without any configuration. See [how bot detection works](/docs/resources/analytics-bot-detection) for what's caught.

## What is the first-party proxy setting?

The **Exclusions** tab also holds a **First-party proxy** toggle. It doesn't exclude anything — it changes how tinyanalytics reads a visitor's IP address when **your own reverse proxy sits in front of the tracker**.

Turn it on only for one specific topology: your own proxy fronts the tracker **and** that proxy sits behind Cloudflare. In that setup, the network-level client IP is your proxy's address, and the real visitor is the first hop in the `X-Forwarded-For` header. The toggle tells tinyanalytics to trust that hop, so visitor IPs — and the country, region, and network derived from them — are correct instead of showing your proxy.

<Warning>
  **Leave first-party proxy off unless your topology needs it.** `X-Forwarded-For` is a header a client can set, so trusting it when nothing enforces it would let visitor IPs be spoofed. It's off by default, and most sites never turn it on.
</Warning>

## How do I hide my own traffic?

Pick the option that matches what you want to exclude — a single device or an entire network.

<Tabs>
  <Tab title="One device (your browser)">
    Set a `localStorage` opt-out key so that browser stops sending anything. This is the quickest way to exclude yourself. See [opt out of tracking](/docs/configure-tinyanalytics-tracking-script#opt-out-of-tracking).
  </Tab>

  <Tab title="A whole network (your office or home IP)">
    Add your IP address to the **IP** exclusions above, so every device on that network is ignored.
  </Tab>
</Tabs>

## Frequently asked questions

<AccordionGroup>
  <Accordion title="What's the difference between excluding and filtering traffic?">
    An exclusion drops data at collection, before it's ever stored — the traffic never reaches your reports and can't be recovered. A [filter](/docs/analytics-filters) only changes what a report *shows*; the data is still collected. Use an exclusion for traffic you never want to measure, and a filter to focus a report on traffic you did.
  </Accordion>

  <Accordion title="Can I recover traffic that tinyanalytics excluded?">
    No. Excluded traffic is dropped at collection and never stored, so there's nothing to restore. If you might want the data later, use a [filter](/docs/analytics-filters) instead — a filter changes what a report shows without dropping anything.
  </Accordion>

  <Accordion title="Why isn't my user agent exclusion matching?">
    User agent exclusions match a **case-insensitive substring**, not a wildcard pattern. A `*` in a user-agent entry is treated as a literal character, so write `curl` rather than `curl/*`. Path and hostname exclusions do support `*` wildcards.
  </Accordion>

  <Accordion title="How many exclusion entries can I add?">
    Each exclusion list in tinyanalytics holds up to **100 entries** of up to **256 characters** each. That limit applies per list — IP address, country, path, hostname, user agent, and referrer each get their own.
  </Accordion>

  <Accordion title="Why does my own domain appear as a referral?">
    Hops between your root domain and its subdomains are already handled — `example.com` to `app.example.com`, in either direction, stays one session and is classified Internal. Sibling subdomains like `app.example.com` to `blog.example.com` are the exception, because they share no parent-child relationship. Add your root domain to **Referrer Exclusions** on the site's **Settings → Exclusions** tab to cover them.
  </Accordion>

  <Accordion title="Does excluding a referrer delete that traffic?">
    No. A referrer exclusion is the one item on the Exclusions tab that keeps your data: the visit is still recorded in full, but its referrer is cleared and its channel becomes **Direct** rather than Referral. The other five lists — IP address, country, path, hostname, and user agent — drop the request at collection and can't be recovered.
  </Accordion>
</AccordionGroup>

## Related

<Columns cols={2}>
  <Card title="Configure the tracking script" icon="sliders" href="/docs/configure-tinyanalytics-tracking-script">
    Skip or mask paths, and opt a device out of tracking.
  </Card>

  <Card title="Filter your data" icon="filter" href="/docs/analytics-filters">
    Focus a report without dropping any data.
  </Card>

  <Card title="How bot detection works" icon="robot" href="/docs/resources/analytics-bot-detection">
    What the block-bots toggle filters out.
  </Card>

  <Card title="Verify your setup" icon="circle-check" href="/docs/verify-tinyanalytics-installation">
    Confirm the right traffic is being tracked.
  </Card>
</Columns>


## Related topics

- [Analytics Channels and Attribution](/docs/resources/analytics-channel-attribution.md)
- [Analytics Site Settings](/docs/analytics-site-settings.md)
- [Embed an Analytics Dashboard](/docs/embed-analytics-dashboard.md)
