> 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

AttributeDescription
data-siteSite identifier. Defaults to "default" if omitted.
data-cookieEnable returning-visitor cookie. With ECHELON_COOKIE_CONSENT=true, shows consent banner first.
data-clicksTrack clicks on elements with data-echelon-click attribute.
data-scrollTrack scroll depth milestones (25%, 50%, 75%, 90%, 100%).
data-hoverTrack 1-second hovers on elements with data-echelon-hover attribute.
data-outboundTrack clicks on outbound links (different origin).
data-downloadsTrack clicks on file download links (pdf, zip, dmg, mp3, mp4, etc.).
data-formsTrack form submission events.
data-vitalsTrack 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:

EventTrigger
pageviewVia /b.gif beacon after first user interaction (pointer, scroll, click, keydown) or on visibility change after 4 seconds. Minimum 800ms interaction delay.
bounceNo interaction within 120 seconds, or tab hidden without prior interaction.
session_endTab becomes hidden.
session_resumeTab 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:

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:

Add data-cookie to enable a persistent visitor cookie for returning visitor tracking.

Admin Dashboard


Installation API Reference Bot Defense Configuration Architecture