Basic Usage
Learn how to add Pipetrace tracking to your website.
The Script Tag
Add the Pipetrace script to your website by including this snippet in your <head> tag:
<script
defer
data-site="YOUR_SITE_ID"
src="https://api.pipetrace.andginja.com/t.js">
</script>Script Attributes
deferRequiredEnsures the script doesn't block page rendering. Always include this attribute.
data-siteRequiredYour unique site tracking ID. Find this in your Pipetrace dashboard under Site Settings.
data-apiOptionalCustom API endpoint URL. Only needed for self-hosted installations.
What Gets Tracked Automatically
Once installed, Pipetrace automatically tracks:
Single Page Application Support
Pipetrace automatically detects navigation in SPAs. It hooks into the History API to track page views when you use:
history.pushState()history.replaceState()Browser back/forward buttonsWorks with: React Router, Next.js, Vue Router, SvelteKit, Remix, Astro, and all other modern frameworks.
Hash-Based Routing
If your app uses hash-based routing (e.g., /#/page), enable hash mode:
<script
defer
data-site="YOUR_SITE_ID"
data-hash="true"
src="https://api.pipetrace.andginja.com/t.js">
</script>Privacy Behavior
Pipetrace automatically respects user privacy:
Do Not Track
If a visitor has DNT enabled in their browser, no tracking occurs.
Global Privacy Control
GPC signals are automatically respected.
Localhost Detection
The script automatically disables itself on localhost, 127.0.0.1, .local, and .test domains.
Bot Detection
Bots, crawlers, and automation tools are automatically filtered out.
Verify Installation
Open your browser's developer console (F12) and look for:
[Pipetrace] Tracking initialized (v2.0.0)If you see this message, the script is working correctly.
Troubleshooting
No console message?
Check that your data-site attribute is correct and the script URL is accessible.
Script blocked by ad blocker?
Some ad blockers may block analytics scripts. Consider using a custom domain or self-hosting the script.
DNT/Bot detected message?
This is normal behavior. The script won't track visitors with DNT enabled or when it detects automated traffic.