Excluding Pages
Learn how to exclude specific pages from being tracked.
Why Exclude Pages?
There are several reasons you might want to exclude certain pages from tracking:
Admin Areas
Exclude admin panels and dashboards
Thank You Pages
Avoid duplicate conversion tracking
Payment Pages
Exclude checkout and payment flows
Internal Tools
Exclude internal staff-only pages
Using Script Attributes
The simplest way to exclude pages is using the data-exclude attribute on your tracking script.
<script
async defer
src="https://sitetooling.space/track.js"
data-token="YOUR_TOKEN"
data-exclude="/admin/*,/dashboard/*,/private/*"
></script>Use comma-separated patterns. Wildcards (*) match any characters in a path segment.
Using JavaScript
For more complex logic, use the JavaScript API to conditionally disable tracking.
// Disable tracking on specific pages
if (window.location.pathname.startsWith('/admin')) {
siteTooling.disable();
}
// Or disable based on user role
if (currentUser.isStaff) {
siteTooling.disable();
}Pattern Examples
| Pattern | Matches |
|---|---|
| /admin/* | All pages under /admin/ |
| /dashboard | Exact match for /dashboard |
| */private/* | Any /private/ subdirectory |
| /api/* | All API endpoints |