Changing site settings needs the owner or admin role on the site.
Exclude pages
With data-exclude
List the paths indata-exclude, separated by commas or spaces:
*matches anything, including slashes:/admin/*covers/admin/usersand/admin/users/42. It does not cover/adminitself, so list/adminas well if that page exists.*is not limited to a segment, so/admin*covers/adminand/admin/users, and also/administratorand/admin-tools. For a section and nothing else, list/admin, /admin/*.- A pattern matches the whole path, so
/previewdoes not cover/preview-pricing. A trailing slash is optional:/previewalso covers/preview/. - Only the path is compared, not the query string or the fragment.
excluded path for each event the script holds back.
With Excluded paths in settings
In Settings, General, Excluded paths, add a pattern and select Add path. The collector drops events from matching paths. A site can have up to 200 patterns, and each starts with/.
The collector reads patterns a little differently from the script:
Patterns are compared with the stored path, without the query string or a hash route. Use settings when you cannot redeploy, or when the same rule should hold for every copy of the snippet.
Exclude other hostnames
With data-domains
data-domains makes the script send only on the hostnames you list, and their subdomains:
staging.example.net or on a scraped copy of your site, the script then sends nothing. The snippet in Settings, Tracking code already has data-domains with your site’s Domain and Additional hostnames.
With Domain and Additional hostnames in settings
The collector only accepts events from the hostnames a site allows, whatever the script does:- With no additional hostnames, the site’s Domain and all its subdomains are counted.
- Once you add an entry under Additional hostnames, the collector counts the domain itself plus the exact hostnames you listed. Subdomains of the domain that are not listed stop counting, so add each one you want, such as
app.example.comanddocs.example.com.
www. and port numbers are ignored on both sides. A site can have up to 50 additional hostnames. Events from any other hostname are dropped, so a copy of your snippet on someone else’s site does not reach your numbers.
Exclude IP addresses
In Settings, General, Excluded IP addresses, enter an IPv4 or IPv6 address and select Add address. Visits from that address are dropped from then on. Use it for your office or home network. Only a one-way SHA-256 hash of the address is stored. The list shows the first characters of each hash, not the address, so note which address you added if you will want to remove it later. A site can exclude up to 200 addresses. The collector hashes the address exactly as it arrives on the request and compares the hashes, so two spellings of the same IPv6 address, such as2001:db8::1 and 2001:0db8:0:0:0:0:0:1, are different entries. Enter IPv6 addresses in their compressed lowercase form, such as 2001:db8::1. Behind a first-party proxy, the address compared is the first one in X-Forwarded-For when it is a public address. If your proxy does not forward the visitor’s address, the collector sees your proxy’s address instead.
Exclude your own browser
To stop counting your own visits in one browser, open your site, open the browser’s developer console and run:example.com and app.example.com. To count your visits again:
Respect Do Not Track
Adddata-dnt to skip browsers that send the Do Not Track signal:
Traffic dropped without any setting
Some traffic never counts, whatever you configure:- The script does not run tracking in automated browsers that set
navigator.webdriver, in Cypress, on local pages unless you adddata-allow-localhost, or while a page is prerendering. - The collector always drops AI crawlers (they are reported on AI crawlers instead). At the Standard and Strict levels of Bot filtering in Settings, General, it also drops requests without a User-Agent and other bots. At Off, only AI crawlers are dropped. See bot filtering.
202, whether it was stored or dropped, so the network panel cannot tell you that an event was excluded.
Next steps
Test on localhost
Send test events from a development build and confirm them.
Bot filtering
Choose how strictly automated traffic is kept out.
Script attributes
Every option the script reads.