Analytics¶
Analytics records events and groups them into profiles. A profile is any actor that can be identified: a person, an agent, a device, a service, or an organization.
Vocabulary¶
| Term | Meaning |
|---|---|
| Profile | The actor an event belongs to. Stored by profile id. |
| Profile properties | Values you set with profile.set / engage. Editable, and only changed when you set them. |
| Event properties | Values sent on one event, such as model, os, or url. |
| Last seen context | A read-only view of the newest event that had each field. It is not stored as profile properties. |
Profile properties and event properties stay separate. A device model sent on app_opened remains an event property. The profile page shows the latest model under last seen context.
Identify¶
The browser SDK starts each visitor on an anonymous id. Call identify when you know who the actor is:
kernstack.push(['identify', 'user_123', { profileType: 'human' }]);
kernstack.push(['identify', 'agent_support', { profileType: 'agent' }]);
kernstack.push(['profile.set', { plan: 'pro' }]);
identify aliases the anonymous id to the profile id and retries that alias if the request fails. Events captured before identify, including ones where distinct_id was still the anonymous id, are merged onto the identified profile.
Use a stable id you already have. Suggested prefixes:
| Prefix | Profile |
|---|---|
user_ |
A person |
agent_ |
An agent |
svc_ |
A service |
Profile type¶
profile_type is human, agent, device, service, organization, or unknown. Set it on identify or with profile.setType. A later identify or set-type call replaces it. An event can fill the type only while it is empty or unknown. Profiles with no type are unknown.
The console can filter the profile list and unique counts by type. Overview Unique profiles counts every type.
Last seen context¶
Last seen context is computed when a profile is read. For each field, the newest event that has a value wins. Event properties win over server-enriched columns for the same field, so a Capacitor os property is shown instead of the user-agent OS. Country, region, and city fall back to geo-IP when the event did not send them.
These fields are derived, not stored:
- A later event cannot leave a stale
last_citybehind, because nothing is written onto the profile. - Two devices keep their own events. The profile shows the newest value for each field, including a model that only one device sent.
- After an alias merge, pre-identify events contribute to the same context. There is no backfill job that copies properties onto the profile.
A property you set yourself named last_model stays a normal profile property. The reserved name last_seen_context is ignored on engage.
On Capacitor, install @capacitor/device and send model, manufacturer, os, and os_version as event properties. They appear in last seen context. They are not written into profile properties.