Data attributes
Everything below works without JavaScript calls – useful in CMSs and page builders (Webflow custom attributes, WordPress blocks).
| Attribute | On | Effect |
|---|---|---|
data-x3-event="name" | any clickable element | Click sends the custom event name |
data-x3-prop-<key>="value" | same element | Adds prop <key> to that event (identifier rules apply) |
data-x3-cta | links, buttons | Click also sends cta_click {label, section} |
data-x3-label="…" | any element | Click label override (otherwise: stable id, aria-label, visible text) |
data-x3-section="name" | any block | Names a section for section reach and click context |
data-x3-ignore | any block | No click labels are captured inside (sensitive areas) |
data-x3-video="id" | <video> or a wrapper | Tracks the video under this id (also without controls) |
data-x3-video-format="landscape|portrait" | same | Overrides the detected format |
data-x3-video-title="Name" | same | Name of the video in the dashboard (else title/aria-label, figcaption, file name) |
data-x3-form="name" | <form> | Form name for form_start/form_submit/form_abandon |
data-x3-404 | any element on a not-found page | The page is reported as /404, CTA detection is off and – with 404 auto-capture on – not_found carries the requested path |
<section data-x3-section="pricing">
<a href="/signup" data-x3-cta data-x3-label="Start trial">Start your free trial</a>
<button data-x3-event="pricing_toggle" data-x3-prop-period="yearly">Yearly</button>
</section>
<form data-x3-form="newsletter">…</form>
<video src="/media/product-tour.mp4" data-x3-video="product-tour" playsinline muted></video>Click labels
Labels are captured only for links, buttons, summary and elements with a button/link role, and
are cleaned: whitespace collapsed, at most 80 characters, anything that looks like an e-mail address,
phone number or generated React id is dropped. Form fields never get a label. Inside
[data-x3-ignore], contentEditable regions and on personal pages no labels are captured at all.
Recordings and heatmaps
data-x3-no-replayon<html>: no session recording on this page at all (the page opts out; heat signals still follow the capture settings). Use it for pages the exclusion list cannot describe.data-x3-mask-linkson a container (or<html>): link targets inside are never recorded, under every links option, and link clicks inside are onlyinternalorexternal– no path, no host, nomailto/tel/messenger kind. For apps whose own links carry tenant names, keys or addresses (/acme-gmbh/shop/settings, a hand-over mail). The page address of a recording always follows the links option (query exceptutm_*and click ids removed, id and token segments replaced).- The heatmap plugin treats a change of
data-state(as rendered by Radix/shadcn menus, tabs and accordions),aria-expanded,aria-hidden,open,hidden,classorstyleas a possible overlay state (menu open, quiz step) – no markup is needed, the attributes are only read.
Legacy attributes
Projects with tracking.legacyTrackAttributes = true also read the legacy data-track-*
markup: data-track, data-track-cta, data-track-section, data-track-ignore,
data-track-video, data-track-video-format, data-track-404.
Constants
DATA_ATTRIBUTES (attribute names by purpose, e.g. DATA_ATTRIBUTES.cta === "data-x3-cta") and
LEGACY_DATA_ATTRIBUTES (the data-track-* equivalents) are exported from @x3growth/sdk, so
components can render the markup without hard-coding names.
CTA selectors
Besides data-x3-cta, the tracking config can list CSS selectors whose matches count as CTAs
(tracking.cta.selectors, e.g. .btn-primary, a[href$="#contact"]) – handy when you cannot
change the markup.