Configuration
All available configuration options for the Pipetrace tracking script.
Configure the tracking script using data-* attributes on the script tag. All options except data-site are optional.
Full Configuration Example
<script
defer
data-site="YOUR_TRACKING_ID"
data-api="https://api.pipetrace.andginja.com"
data-hash="false"
data-outbound="true"
data-downloads="true"
data-scroll="true"
data-errors="true"
data-forms="true"
src="https://api.pipetrace.andginja.com/t.js">
</script>All Configuration Options
| Attribute | Type | Default | Description |
|---|---|---|---|
data-site | — | Your unique site tracking ID from the Pipetrace dashboard. | |
data-api | Inferred from the script URL | Custom API endpoint URL for self-hosted installations. | |
data-hash | false | Enable tracking for hash-based routing (e.g., /#/page). | |
data-outbound | true | Disable automatic outbound link click tracking. | |
data-downloads | true | Disable automatic file download tracking. | |
data-scroll | true | Disable scroll depth milestone tracking. | |
data-errors | true | Disable JavaScript error tracking. | |
data-forms | true | Disable form interaction tracking. | |
data-exclude | — | Comma-separated paths that send nothing, each starting with /, e.g. /account, /account/**. * matches within one path segment, ** across segments. |
Minimal Setup
For most sites, you only need the site ID:
<script defer data-site="YOUR_TRACKING_ID" src="https://api.pipetrace.andginja.com/t.js"></script>Disabling Features
To disable automatic tracking of certain features, set the attribute to "false":
<!-- Disable outbound link and download tracking -->
<script
defer
data-site="YOUR_TRACKING_ID"
data-outbound="false"
data-downloads="false"
src="https://api.pipetrace.andginja.com/t.js">
</script>Self-Hosted Installation
If you're running a self-hosted Pipetrace instance, point to your own API:
<script
defer
data-site="YOUR_TRACKING_ID"
data-api="https://analytics.yourdomain.com"
src="https://analytics.yourdomain.com/t.js">
</script>Hash-Based Routing
For apps using hash-based URLs (e.g., example.com/#/page):
<script
defer
data-site="YOUR_TRACKING_ID"
data-hash="true"
src="https://api.pipetrace.andginja.com/t.js">
</script>With hash mode enabled, navigation like /#/page1 to /#/page2 will be tracked as separate page views.
Excluding Pages
Keep private pages, such as purchases, account and admin pages, out of analytics completely:
<script
defer
data-site="YOUR_TRACKING_ID"
data-exclude="/purchases, /purchases/**, /admin, /admin/**, /reports/*/private"
src="https://api.pipetrace.andginja.com/t.js">
</script>* matches any characters except /, and ** matches across path segments. Everything else is literal. A pattern without a wildcard matches that exact path, with or without a trailing slash, so list /purchases/** as well for the pages below it. Patterns match the path without its query string or hash, or the hash route when data-hash="true".
Because * stays within one path segment, /admin* covers /admin-panel but not /admin/users: list /admin, /admin/** to exclude a section and everything below it.
On an excluded page the script sends nothing at all and uses no browser storage (except consent calls, which update the stored choice as they do elsewhere), including after an in-app navigation into it: the previous page's data is sent first, and tracking resumes on the next page that is not excluded. Custom events, goals, revenue and identify calls made there are dropped. A consent choice made there still applies from the next included page.
Privacy Considerations
The script automatically respects privacy settings:
- Do Not Track: Do Not Track keeps the visitor at tier 1 at most, even after the visitor accepts.
- Global Privacy Control: Global Privacy Control stops all collection: nothing is stored from a request that carries it.
- Visitor Storage: At tiers 1 and 2, the tracker stores nothing in the visitor's browser. It reads one thing, and only before switching to tier 3: an opt-out saved in localStorage (_pt_consent) by the older optOut() call. If it finds one and the visitor has not accepted, it stays at tier 1. Tier 3 stores a random visitor ID in the first-party cookie _pt_vid, which expires 730 days (about 2 years) after it was last set (the tracker sets it again on every tier 3 page load), and in localStorage and IndexedDB, which have no expiry; it keeps a per-tab session ID in sessionStorage. Privacy tiers
- Bot Filtering: Automated traffic is automatically excluded