Skip to content

EdgeKitTrackerOptions

EdgeKitTrackerOptions = object

optional anonymousTracking?: boolean

Snowplow’s cookie-free mode. Off by default. Useful before consent when your organization’s consent basis is consent_required.


optional collectorOrigin?: string

Origin to send events to. Defaults to the page’s own origin, where the collector is mounted under EdgeKitTrackerOptions.pathPrefix. Same origin means no CORS preflight and no Content Security Policy change.


optional pathPrefix?: string

Path the collector is mounted under. Defaults to /edgekit. Events are posted to {pathPrefix}/a/t.


optional plugins?: BrowserPlugin[]

Snowplow browser plugins. Install each @snowplow/browser-plugin-* package yourself, at the version matching this package’s @snowplow/browser-tracker. Pass the plugins here (for example [FormTrackingPlugin()]), then switch each one on with its own enable* function, passing EdgeKitTracker.name.


optional requireConsent?: boolean

When true, every track* call is held in memory until EdgeKitTracker.grantConsent is called. Held events are lost if the page unloads first. Set it from your consent management platform (CMP).

Consent is enforced only here, in the browser. The collector does not check it.


siteId: string

The site’s id in EdgeKit, sent as Snowplow’s appId. Every event is filed under this id exactly as sent. The collector never refuses an event for an unknown id, so a typo here is not reported back to the page.


optional trackerConfiguration?: Partial<TrackerConfiguration>

Any Snowplow TrackerConfiguration option. Applied last, so it overrides the defaults createTracker sets, postPath included.

Leave retryStatusCodes and dontRetryStatusCodes at Snowplow’s defaults: the collector answers 400, 401, 403, 410 or 422 only when retrying cannot succeed, and relies on everything else being retried.