Skip to content

Client-Side JavaScript API

SignalRelay exposes the global window.signalRelay object in the browser for custom scripts and theme developers.


Available Methods

signalRelay.track(eventName, customData, userData)

Dispatches an event simultaneously to active browser pixels and the server-side REST endpoint with a synchronized, deduplicated event_id.

window.signalRelay.track('Lead', {
content_name: 'Strategic Consultation',
value: 150.00,
currency: 'USD'
}, {
email: 'client@example.com',
phone: '+14155552671'
});
  • eventName (string, required): Standard or custom event name.
  • customData (object, optional): Event properties (value, currency, content_name).
  • userData (object, optional): Customer match information (email, phone, first_name, last_name). Normalized and hashed with SHA-256 on your server prior to API delivery.

signalRelay.grantConsent()

Programmatically grants marketing tracking consent, unlocking event transmission if your site runs a deny-by-default posture.

// Call when visitor accepts cookies in a custom banner
window.signalRelay.grantConsent();

signalRelay.revokeConsent()

Revokes tracking consent and immediately blocks subsequent event dispatches.

window.signalRelay.revokeConsent();