Identifying visitors and passing metadata in Live Chat
Updated June 14, 2026
Visitor identity
By default, visitors are anonymous with a session ID persisted in localStorage. To attach a known user you have two options:
- Pre-identify at init — pass
userId,email, and/ornamedirectly in theinit()call. This is the recommended approach when using Google Tag Manager or server-rendered pages where the user is already known at page load. - Identify after login — call
Inquiru("identify", { userId, email, name })any time after the widget initialises — for example, once your own login flow completes.
Either way, the identity is stored on the conversation and shown in the Live Chat inbox and Conversations page. Values of undefined or null (including the string "undefined" returned by GTM when a variable is unset) are automatically ignored, so unrecognised visitors are safely treated as anonymous.
Passing custom metadata
You can attach arbitrary key-value metadata to a session via the metadata object in init():
Inquiru('init', { widgetId: 'your-widget-id', userId: '{{cookie - User ID}}', email: '{{cookie - User Email}}', metadata: { api_key: '{{cookie - API Key}}' } });
Metadata values are stored on the conversation and made available as template variables in API Skill headers and body templates using the syntax {metadata.key_name} — for example, setting a header X-API-Key: {metadata.api_key} will be substituted with the visitor's actual key at call time. This lets you call per-user authenticated APIs without storing credentials server-side.
