Skip to content

createTracker

createTracker(options): EdgeKitTracker

Create a Snowplow tracker that sends one site’s events to EdgeKit’s collector.

const analytics = createTracker({ siteId: 'st_sports' });
analytics.trackPageView();

Defaults it sets, each overridable through EdgeKitTrackerOptions.trackerConfiguration:

  • eventMethod: 'post'
  • postPath: {pathPrefix}/a/t, so /edgekit/a/t by default
  • bufferSize: 1, one event per request

Every method on the returned tracker sends to this tracker only, never to another Snowplow tracker on the same page.

A page_view is not a metered read. Page views and metered reads are counted separately, and neither is computed from the other: bots, prefetch, preview traffic and reads under a grant can each move one and not the other.

EdgeKitTrackerOptions

EdgeKitTracker