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

# Exclude visits from analytics

> Stop Trfyx from counting visits that match an IP, country, page, query parameter, hostname, or user-agent rule. Rules apply to new traffic only.

Exclusions tell Trfyx not to record visits that match rules you set for a site. Open **Settings → Exclusions** and add a rule. The next matching pageview, custom event, session replay batch, heatmap batch, or web-vitals payload is dropped and never stored.

Rules do not rewrite reports you already have. Visits collected before you saved a rule stay in analytics.

> [!NOTE]
>
> You need permission to configure the site (editor, admin, or owner) to add or remove rules.

## How a rule is saved

Each card is its own list. Add and remove save immediately. A value that is already in that list (ignoring case) is rejected. Internal traffic, Pages, Query parameters, Hostnames, and User agents each accept up to 100 rules.

## Rule types

The cards use the same names as the Exclusions settings tab.

### Internal traffic

Ignore visits from your own or your team's IP addresses.

Accepted formats:

| Format | Example | Notes |
| - | - | - |
| Single IPv4 or IPv6 | `1.2.3.4` | Exact match |
| CIDR block | `10.0.0.0/24` | IPv4 and IPv6 |
| IPv4 range | `1.2.3.4-1.2.3.9` | Inclusive. IPv6 ranges are not accepted. Use CIDR instead, such as `2001:db8::/32` |

Trfyx compares the visitor IP it sees on the request, including addresses forwarded by a proxy or CDN. If your office shares one public IP, one rule covers the team. If people use a VPN, add the VPN exit address they actually connect from.

### Countries

Ignore visits from selected countries. Pick a country from the list. Matching uses the visitor's IP location. If Trfyx cannot determine a country, a country rule does not match that visit.

### Pages

Ignore visits whose URL path matches a pattern, such as `/admin/*`. Matching is case-insensitive and uses `*` as a wildcard for any sequence of characters, including none. The pattern must match the whole path, not a substring.

`/admin/*` matches `/admin/` and `/admin/users`. It does not match `/admin`, because the pattern still requires the slash after `admin`.

### Query parameters

Ignore visits whose page URL contains a matching query parameter.

* `preview` matches any value for that name, including an empty value.
* `utm_source=internal` matches that name when the value matches the pattern.
* The value side accepts `*`, so `utm_source=int*` matches `internal`.

Names are compared case-insensitively. A URL with no query string cannot match.

### Hostnames

Ignore traffic from staging or preview hostnames. Matching is case-insensitive against the page hostname and uses `*` the same way as Pages. `*.vercel.app` matches `foo.vercel.app`. It does not match `vercel.app`.

### User agents

Ignore bots and tools whose user agent contains the text you enter, such as `HeadlessChrome`. Matching is case-insensitive and is a substring check, not a wildcard pattern. `*` is treated as a literal character.

## Test a pattern

Type a rule and a sample value to see whether Trfyx would exclude that visit. This uses the same matching rules as the product for Pages, Query parameters, Hostnames, and User agents.

Rule type

Rule

## What each product surface does

When a visit matches any rule:

* **Analytics events** (pageviews and custom events) are not stored.
* **Web vitals** for that page are not stored.
* **Session replay and heatmaps** treat visitor rules and page rules differently:
  * Internal traffic, Countries, or User agents: recording stops for that visitor.
  * Pages, Query parameters, or Hostnames: that page's batch is dropped. Recording can continue on other pages that do not match.

> [!WARNING]
>
> Removing a rule does not restore visits that were dropped while it was active. Those events were never stored.

## Common problems

> [accordion] I still see my own visits
>
> Confirm the address your browser actually uses (IPv4 vs IPv6, office NAT, or VPN). Add that address, a CIDR block, or an IPv4 range. A country rule does not help if your location cannot be resolved.

> [accordion] A path or hostname rule does not match
>
> Pages match only the URL path (`/pricing`, not `https://example.com/pricing`). Hostnames match only the host (`staging.example.com`). The pattern must cover the whole value. Check leading slashes and whether you need a trailing `/*`.

> [accordion] A query parameter rule does not match
>
> The page URL must include that query string. `preview` matches any value. `preview=1` matches only that value (unless you add a `*` on the value side).

> [accordion] Old visits are still in reports
>
> Exclusions apply to new incoming data only. Past pageviews, events, replays, heatmaps, and vitals stay as they were collected.

> [accordion] A user-agent rule with \* does nothing
>
> User agents do not treat `*` as a wildcard. Enter a substring that actually appears in the user agent, such as `HeadlessChrome` or `curl`.

## Next steps

* [Install tracking](https://help.trfyx.com/install-tracking.md) if the script is not on the pages you are testing.
* [Session replay](https://help.trfyx.com/session-replay.md) for how recordings are used after capture.
* [Troubleshooting](https://help.trfyx.com/troubleshooting.md) if numbers still look wrong after you rule out exclusions.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.