Skip to content

EdgeKitTracker

EdgeKitTracker = object

name: string

This tracker’s Snowplow name. Pass it to every plugin’s enable* function, such as enableActivityTracking or enableFormTracking. Without a tracker list, those functions apply to every Snowplow tracker on the page, including any other one your site runs.

enableActivityTracking({ minimumVisitLength: 15, heartbeatDelay: 15 }, [
analytics.name,
]);

setUserId: typeof setUserId

Set the user_id sent, unchanged, on every later event. Applies at once, even while consent is pending: it sends nothing by itself.


trackPageView: typeof trackPageView

Track a page_view.


trackSelfDescribingEvent: typeof trackSelfDescribingEvent

Track a self-describing event, whose schema is an iglu: URI in your schema registry. The collector checks the event against that schema. An event that fails the check is still accepted with 200 and kept apart as invalid.


trackStructEvent: typeof trackStructEvent

Track Snowplow’s legacy five-field structured event. It has no schema, so nothing validates it.

grantConsent(): void

Grant consent: send every held event, in the order it was tracked, then send new events straight away.

A no-op when requireConsent was not set, so a page can call it without knowing your organization’s consent basis.

void


revokeConsent(): void

Forget this device. Drops held events and clears this tracker’s user and session identifiers from cookies and local storage. With requireConsent set, events are held again until the next EdgeKitTracker.grantConsent; without it, tracking continues under new identifiers.

Not erasure: events already collected are not deleted. Call it from your CMP’s withdraw action.

void