Skip to content

Identifying visitors

Use identify() to attach an identity and custom attributes to the current visitor. Standard fields are promoted to the visitor profile; everything else is stored as custom attributes and shown to your agents.

js
window.laneChat.identify({
  email: '[email protected]',   // standard field -> promoted to the visitor profile
  name: 'Jane Doe',         // standard field
  phone: '+1 415-555-2671', // standard field
  plan: 'pro',              // custom attribute -> stored as-is, visible to agents
  seats: 12,
})

setFromData(data) is a historic alias of identify() with identical behavior.

Behavior contract

  • In-place and fire-and-forget. identify() never remounts the widget and never drops the session.
  • Idempotent. An identical payload is a no-op.
  • Callable any time. Calls made before the widget mounts are buffered and applied once it does; after that they are sent as you make them.
  • Prefer it over remounting. To update visitor data, always call identify() — never destroy() + init().

Standard fields

These keys are promoted to dedicated fields on the visitor profile. Keys are case-insensitive, and - or spaces are read as _ (so Email Address and email_address are the same key).

Profile fieldAccepted keysValidation
emailemail, email_addressMust be a valid email address
phonephone, phone_numberNormalized to +?digits (7–15 digits)
namenameTrimmed, must be non-empty

Promotion rules (server side)

  • Fill-if-empty. A standard field is written only when that profile field is currently empty.
  • Conflicts are kept, not applied. A differing, non-empty email or phone is recorded against the visitor for your agents to see; the value already on the profile is never overwritten. name conflicts are ignored.
  • Invalid values are silently skipped — never an error, never a block.
  • Non-standard keys are stored verbatim as custom attributes and are never promoted to profile fields.

Custom attributes

Any key that is not a standard field is stored as-is and surfaced to agents in the visitor panel — the same "push data" pattern you may know from other tools:

js
window.laneChat.identify({
  plan: 'enterprise',
  mrr: 4200,
  signup_date: '2026-01-14',
  account_id: 'acct_9f12',
})

Agents see plan, mrr, signup_date, and account_id alongside the conversation.

Native apps

The iOS and Android SDKs expose the same concept as identify(userId:traits:). Traits are forwarded into the in-app chat and shown to agents, and the SDK also binds an external_user_id so one device maps to one visitor identity across native and web.

They also split the data in two, which is worth knowing before you decide where a value belongs:

  • identify(userId, traits) — who this person is. Persists across every future conversation.
  • setSessionData(data) — what this conversation is about (order id, cart total, the screen they reached out from). Merged, not replaced, and it does not follow them into the next conversation.

setSessionData is available on Android and iOS; the Flutter package does not have it yet. See Native SDK.

Lane.Chat — AI customer support, multichannel CRM, and roleplay AI.