Skip to main content
sdk

Track

active
Audience: developerUpdated 2026-07-26

The Track call records an action a customer performed — an event with a name and a set of properties describing it. Together with Identify, it is the whole tracking contract, and the same shape applies whether the call comes from the Web SDK, the Native SDK, or a direct Tracking REST request.

Example

A minimal Track call needs only an event name and an identity:

{
"type": "track",
"event": "product_viewed",
"userId": "user_8421",
"properties": {
"product_id": "507f1f77bcf86cd799439011"
}
}

The matching Web SDK call:

Binoban.track("product_viewed", {
product_id: "507f1f77bcf86cd799439011",
});

A fuller payload, showing the fields you'll see on most real events:

{
"type": "track",
"event": "order_completed",
"userId": "user_8421",
"anonymousId": "b7e1c9f0-6b2a-4e9a-9c3d-2f6a1d9e4b71",
"timestamp": "2026-07-26T14:32:00.000Z",
"properties": {
"order_id": "50314b8e9bcf000000000000",
"revenue": 84.5,
"currency": "USD"
},
"context": {
"page": {
"url": "https://shop.example.com/checkout/confirmation",
"path": "/checkout/confirmation"
},
"traits": {
"email": "customer@example.com"
}
}
}
Binoban.track("order_completed", {
order_id: "50314b8e9bcf000000000000",
revenue: 84.5,
currency: "USD",
});

Identities

Every Track call carries userId, anonymousId, or both:

FieldRequired?Max lengthAllowed characters
userIdAt least one of userId / anonymousId64az AZ 09 _ - . @ :
anonymousIdAt least one of userId / anonymousId64az AZ 09 _ - . @ :

Send both when you have them — an anonymous visitor who later signs in should carry the same anonymousId it always had, plus the new userId. Omitting both rejects the call with error.sdk.missing.id. A value using disallowed characters rejects it with error.sdk.user.id.pattern / error.sdk.anonymous.id.pattern; a value over 64 characters also rejects the call, but the exact code that response carries isn't confirmed — the length check runs through generic validation, not the pattern check that's wired to those codes. See Limits & validation for the full rejection table.

This is a wire-level rule, not the whole identity model — read Identity strategy for how Binoban decides two events belong to the same person, and when to call identify instead of just carrying an id on track.

Event

event is a required string naming what happened. Name it in human-readable, past tenseproduct_viewed, order_completed — not a generic label like Event 12 or a present-tense verb. The event name is a contract: audiences, Engage journeys, and Insights reports all key off the exact string you send, so an inconsistent name (orderCompleted on one page, order_completed on another) silently splits one event into two.

Binoban maintains a catalog of standard ecommerce event names — use one of those where your action fits, so your data lines up with the built-in reports and journeys without extra mapping. See the Ecommerce event catalogue.

The name itself is validated like any other name in the system:

RuleValue
RequiredYes
Max length64 characters
Allowed charactersaz AZ 09 _ - .

A name using disallowed characters (spaces, for example) rejects the call with error.sdk.event.name.pattern. A missing or over-length name also rejects the call — event is @Required, so an empty string doesn't satisfy it — but the exact code isn't confirmed for either case: only the character-pattern check is wired to error.sdk.event.name.pattern; the required/length checks fall back to generic validation.

Properties

properties is an optional, free-form dictionary describing the event — price, quantity, product_id, or anything else specific to what you're tracking. Send properties whenever you have them; an event with no properties still records that the action happened, but the properties are what make it useful downstream (segmenting an audience on revenue, for instance).

Property names (keys) follow the same rule as event names:

RuleValue
Max length64 characters
Allowed charactersaz AZ 09 _ - .

A property name over the limit or with disallowed characters rejects the whole call (error.sdk.attribute.name.length / error.sdk.attribute.name.pattern). Property values have their own type-based ranges — see Limits & validation — and a value that breaks its range is silently dropped rather than rejecting the call.

Track has no reserved-property list. Unlike Identify's traits (where a handful of names like email get special length limits), every Track property is validated the same way regardless of its name — there's no backend concept of a property Binoban treats specially just because it's called revenue or currency. What you will find is per-event convention: the Ecommerce event catalogue defines which property names carry meaning on each standard event (for example, price and currency on product_viewed). Use those exact names on standard events so downstream tooling can rely on them — but that's a documentation convention scoped to those events, not a platform-wide reserved list enforced at ingestion.

Context

context is an optional object carrying environment and identity-adjacent information about where the event came from. These are the fields the tracker actually accepts:

FieldTypeDescription
context.activeBooleanWhether the underlying session/device is currently active.
context.app.nameStringApplication name.
context.app.packageNameStringApplication package/bundle identifier.
context.app.versionStringApplication version.
context.app.buildStringApplication build number.
context.campaign.nameStringMarketing campaign name.
context.campaign.sourceStringCampaign source.
context.campaign.mediumStringCampaign medium.
context.campaign.termStringCampaign term.
context.campaign.contentStringCampaign content.
context.device.idStringDevice identifier.
context.device.sdkStringPush delivery platform for this device: WEB, ANDROID, or IOS.
context.device.advertisingIdStringAdvertising identifier.
context.device.tokenStringPush token.
context.device.manufacturerStringDevice manufacturer.
context.device.modelStringDevice model.
context.device.nameStringDevice name.
context.device.typeStringDevice type.
context.device.versionStringDevice OS/hardware version.
context.device.webViewIdStringIdentifier for a webview instance, used to align Native and Web SDK identity in a webview — see Webview behavior.
context.ipStringIP address the event was sent from.
context.library.nameStringName of the SDK that sent the event.
context.library.versionStringVersion of the SDK that sent the event.
context.localeStringLocale, e.g. en-US.
context.network.bluetoothStringBluetooth connectivity state.
context.network.carrierStringMobile carrier.
context.network.cellularStringCellular connectivity state.
context.network.wifiStringWi-Fi connectivity state.
context.os.nameStringOperating system name.
context.os.versionStringOperating system version.
context.page.nameStringPage name.
context.page.pathStringPage path.
context.page.referrerStringPage referrer.
context.page.searchStringPage query string.
context.page.titleStringPage title.
context.page.urlStringPage URL.
context.page.keywordsStringPage keywords.
context.referrer.typeStringReferrer type.
context.referrer.nameStringReferrer name.
context.referrer.urlStringReferrer URL.
context.referrer.linkStringReferrer link.
context.userAgentStringBrowser/device user agent string.
context.timezoneStringTimezone.
context.traitsObjectFree-form dictionary — see below.

context.traits deserves special attention. It's how a Track call carries traits collected on an earlier Identify call along with the event, and — on any non-Identify call — it's also the field Binoban's identity resolution reads for phone, email, or custom-trait matching, if your workspace has one of those enabled. See Identity strategy for how that matching works and how to turn it on.

Some device identifiers are intentionally omitted

context.device carries two more fields tied to specific ad-network integrations. They aren't documented here because they haven't been confirmed as general, publicly-supported SDK concepts — ask your Binoban team if you believe you need them.