tracklane

API reference

Public API, generated from the library source

Generated from the TSDoc in the library source, so these tables cannot drift from the code.

The browser and the server are two libraries. They share no runtime and no state: only the vocabulary below, which is what makes purchase mean the same thing on both sides.

The vocabulary

EventData

What the business says happened, spelled the way GA4 spells it. The bag stays open: a business measures things this vocabulary does not name.

Prop

Type

UserData

Who the person is. One identifier, translated into each vendor's own name. Values stay raw: hashing is a field format each vendor defines, applied inside its adapter.

Prop

Type

ConsentState

Google's signals, adopted verbatim. Every other vendor receives a collapse of these, never an expansion. An absent signal produces no key.

Prop

Type

TrackingError

The one diagnostic channel. It never carries event contents.

Prop

Type

Browser

createTracking is the entry point for this half: it takes a BrowserTrackingOptions and returns a BrowserTracking.

TrackOptions

The only thing the browser needs beyond the event itself.

Prop

Type

BrowserTrackingOptions

What createTracking takes: the providers to send to, and an optional error channel.

Prop

Type

BrowserTracking

Prop

Type

BrowserProvider

The whole contract for a browser destination. Providers shipped here get no shortcut your own does not have.

Prop

Type

Server

createTracking is the entry point for this half: it takes a ServerTrackingOptions and returns a ServerTracking.

EventContext

Who, when and where: everything a conversion API needs beyond the event itself.

Prop

Type

ResolvedContext

What an adapter actually receives: EventContext with cookies parsed into a map and timestamp resolved to a number.

Prop

Type

ServerTrackingOptions

What createTracking takes: the providers to send to, and an optional error channel.

Prop

Type

ServerTracking

Prop

Type

ServerProvider

Prop

Type

On this page