JavaScript API
Events, tags, leads, consent and opt-out from your code.
Once the tracking code is on the page, the global RX() function lets your website send events, tags and leads, and control consent. Calls made before the tracker has loaded are queued and sent once it's ready.
Calling RX safely
If your code may run before the tracking code loads, add this one-liner first:
window.RX = window.RX || function(){ (RX.q = RX.q || []).push(arguments) };
RX('event', name)
Marks a moment in the recording. Events appear in the player timeline, the Events log and Top events, and can be funnel steps.
RX('event', 'add_to_cart');
RX('event', 'video_played');
RX('tag', key, value)
Labels the whole visit, for example with a plan, a form step or an A/B variant from your own tool. Filter recordings by key=value.
RX('tag', 'plan', 'pro');
RX('tag', 'form_step', '3_payment');
RX('lead', name)
Counts the visit as a lead or conversion (in addition to any thank-you pages you've listed in Settings).
RX('lead', 'quote_requested');
RX('consent', true | false)
Tells SitePluse the visitor accepted (or withdrew) consent. Use this when consent mode is set to "My site calls RX('consent', true)".
RX('optout') · RX('optin') · RX('stop')
optout stops recording this visitor now and on future visits; optin undoes it. stop ends the current recording without remembering anything.
HTML attributes
| Attribute | Effect |
|---|---|
data-rx-mask | Always mask this element's text and input |
data-rx-block | Leave this element out of the recording (shown as a grey box) |
data-rx-ignore | Don't record typing in this field |
Can't find what you need? E-mail session@sitepluse.io.