> Features
Tracking features, script tag options, JS API, and SPA support.
Script Tag
Basic embed — add to any HTML page:
<script async src="https://your-host/ea.js" data-site="my-site"></script>
Script Attributes
| Attribute | Description |
|---|---|
data-site | Site identifier. Defaults to "default" if omitted. |
data-cookie | Enable returning-visitor cookie. With ECHELON_COOKIE_CONSENT=true, shows consent banner first. |
data-clicks | Track clicks on elements with data-echelon-click attribute. |
data-scroll | Track scroll depth milestones (25%, 50%, 75%, 90%, 100%). |
data-hover | Track 1-second hovers on elements with data-echelon-hover attribute. |
data-outbound | Track clicks on outbound links (different origin). |
data-downloads | Track clicks on file download links (pdf, zip, dmg, mp3, mp4, etc.). |
data-forms | Track form submission events. |
data-vitals | Track Core Web Vitals: LCP, CLS, INP. |
Enable Everything
<script async src="https://your-host/ea.js" data-site="my-site" data-cookie data-clicks data-scroll data-hover data-outbound data-downloads data-forms data-vitals></script>
HTML Element Markup
Annotate elements to track specific interactions:
Click Tracking
Requires data-clicks on the script tag.
<button data-echelon-click="signup-cta">Sign Up</button>
Hover Tracking
Requires data-hover on the script tag. Fires after 1 second of hover.
<div data-echelon-hover="pricing-card">...</div>
Form Tracking
Requires data-forms on the script tag.
<form data-echelon-form="contact-form">...</form>
Custom Data Attributes
Any data-echelon-* attribute on annotated elements is included in event data (max 8 keys, max 256 chars per value).
<button data-echelon-click="buy" data-echelon-product="widget" data-echelon-price="9.99">Buy Now</button>
JavaScript API
Send custom events programmatically:
window.echelon.track("event_name", {
key: "value",
another: "prop"
});
Limits: max 16 properties, key max 64 chars, value max 512 chars.
Auto-Tracked Events
These fire automatically — no configuration needed:
| Event | Trigger |
|---|---|
pageview | Via /b.gif beacon after first user interaction (pointer, scroll, click, keydown) or on visibility change after 4 seconds. Minimum 800ms interaction delay. |
bounce | No interaction within 120 seconds, or tab hidden without prior interaction. |
session_end | Tab becomes hidden. |
session_resume | Tab becomes visible again after session_end. |
SPA Support
The tracker automatically patches pushState, replaceState, and listens for popstate events. When the route changes, a new pageview beacon fires automatically. No configuration needed for React Router, Vue Router, SvelteKit, Fresh, or any other SPA framework.
UTM Campaign Tracking
UTM parameters are automatically extracted from the URL and persisted in sessionStorage for the session duration:
utm_campaignutm_sourceutm_mediumutm_contentutm_term
All tracked events within the session inherit UTM parameters.
A/B Experiments
Create experiments via the admin dashboard or API. Variants are allocated based on weight. The tracker script automatically picks up experiment assignments and includes experiment_id and variant_id in all events.
Cookieless by Default
Without data-cookie, visitors are identified by a daily-rotating HMAC-SHA256 hash of IP + User-Agent + site ID + date. This produces a 16-character hex identifier that:
- Resets every day — no cross-day tracking
- Cannot be reversed to recover the original IP
- Requires no cookie consent (GDPR/ePrivacy compliant)
Add data-cookie to enable a persistent visitor cookie for returning visitor tracking.
Admin Dashboard
- Overview with KPIs, daily trends, top pages, devices, countries, referrers
- Realtime visitor monitoring (10-second polling)
- Bot management — suspicious visitors, exclude/include controls
- A/B experiments — create, manage, view conversion uplift
- UTM campaigns — track and break down by source, medium, content
- Performance metrics — CI/CD benchmark tracking with trends