Skip to main content
Identify the person chatting with your widget by passing their name, email, and your own user ID. Their conversations are then labelled with that name in Activity instead of showing up as anonymous.

How It Works

  1. You pass the user’s attributes — on the <script> tag, or with the update command
  2. The widget stores them in window.ArgideSettings and sends them to Argide
  3. Every conversation from that browser is labelled with the user’s name
How you pass the attributes depends on how your site is built.

Multi-Page Sites

Add the attributes to your embed script. Every full page load re-sends the identity, so no JavaScript is needed.
Render the values server-side from your session. Leave the attributes off for signed-out visitors — the widget still works, the conversation is just anonymous.

The Settings Object

If you know the user before the widget loads, declare window.ArgideSettings before the script tag. It seeds the same attributes at boot, and takes precedence over the data-* attributes:
window.ArgideSettings always holds the current attributes. The update command merges into it.

Single-Page Apps

A single-page app has no full page loads, so the script tag can’t carry an identity that changes after login. Use the update command instead.

The update Command

window.argide('update', { ... }) changes the user’s attributes at any time after the widget loads.
The property is user_id with an underscore — it matches the data-user-id attribute.
An update merges. A property you pass replaces its current value, and a property you leave out keeps its current value. A partial update doesn’t wipe attributes you set earlier:

Custom Attributes

Any property other than user_id, name, email, and visibility is stored as a custom attribute and shown on the conversation in Activity:
Custom attributes merge key by key, so sending { plan: 'pro' } later updates plan and leaves seats alone.
Custom attributes work with window.ArgideSettings and the update command only. The data-* attributes carry just user_id, name, email, and visibility.

Verified vs Unverified

There are two kinds of identity, and the same user can have both:
Unverified attributes are taken on trust. Anyone who reads your page source can send any name, email, or user ID they like, so treat them as labels for your own dashboard — never as proof of who someone is.
If you want the agent to take actions on the user’s behalf against your API, use Identity Verification. A verified user keeps the Verified badge — an update can never take it away. The attributes themselves are still overwritable, so don’t treat a verified name or email as tamper-proof.

Handle Logout

Clear the identity when the user signs out, so the next person on the same browser starts fresh:
window.argide('resetUser') still works as an alias for resetAndPreserveSession, but it is deprecated and logs a console warning. Use the two commands above.

Next Steps

Visibility

Show the widget only to signed-in users

Identity Verification

Let the agent act on the user’s behalf