When a visitor starts a chat, Ticaga can display their details — name, email, company, and more — directly in the agent's Customer Details panel. You can pass this data from your site so agents immediately know who they're talking to without having to ask.
There are two ways to send customer data to the widget.
Method 1 — Data attributes
The simplest approach. Add data-user-* attributes directly to the widget <script> tag.
<script src="..."
data-widget-key="your-key"
data-user-name="Jane Smith"
data-user-email="jane@example.com"
data-user-phone="+1 555 123 4567"
data-user-company="Acme Corp"
data-user-id-code="12345"
data-user-address="123 Main St"
data-user-city="New York"
data-user-country="US"
data-custom-data='[["Plan","Enterprise"],["Account ID","ACC-99"]]'
async></script>
In practice, you would render these values server-side from the logged-in user's session:
<script src="..."
data-widget-key="your-key"
data-user-name="<?= $user->name ?>"
data-user-email="<?= $user->email ?>"
data-user-company="<?= $user->company ?>"
async></script>
Custom fields
The data-custom-data attribute accepts a JSON array of [label, value] pairs, useful for any data that doesn't fit the standard fields:
data-custom-data='[["Plan","Enterprise"],["Account ID","ACC-99"],["Region","EU"]]'
Method 2 — JavaScript queue
If you prefer to keep your data separate from the script tag — or if your values are generated dynamically — use the JavaScript queue. Declare it before the widget <script> tag:
<script>
window.TicagaChat = window.TicagaChat || [];
window.TicagaChat.push(['set', 'user:name', 'Jane Smith']);
window.TicagaChat.push(['set', 'user:email', 'jane@example.com']);
window.TicagaChat.push(['set', 'user:phone', '+1 555 123 4567']);
window.TicagaChat.push(['set', 'user:company', 'Acme Corp']);
window.TicagaChat.push(['set', 'user:id-code', '12345']);
window.TicagaChat.push(['set', 'user:address', '123 Main St']);
window.TicagaChat.push(['set', 'user:city', 'New York']);
window.TicagaChat.push(['set', 'user:country', 'US']);
window.TicagaChat.push(['set', 'session:data', [['Plan','Enterprise'],['Account ID','ACC-99']]]);
</script>
<!-- Widget script must come after the queue -->
<script src="..." data-widget-key="your-key" async></script>
If both a data attribute and a queue entry are set for the same field, the queue entry takes precedence.
Available fields
| Attribute | Purpose |
|---|---|
data-user-name |
Customer's display name — shown in Visitor section header |
data-user-email |
Customer's email — shown in Visitor section header |
data-user-phone |
Phone number — shown in Customer Information sidebar |
data-user-company |
Company name — shown in Customer Information sidebar |
data-user-role |
Customer's role at their company — shown in Customer Information sidebar |
data-user-title |
Job title — shown in Customer Information sidebar |
data-user-plan |
Subscription/service plan name — shown in Customer Information sidebar |
data-user-account-id |
Actual internal billing system user ID — used to match/link to a Ticaga user account via billing_id |
data-user-id-code |
Friendly client reference code (e.g. "Client #1500") — display only in Customer Information sidebar |
data-user-language |
Preferred language — shown in Customer Information sidebar |
data-user-address |
Street address — shown in Customer Information sidebar |
data-user-city |
City — shown in Customer Information sidebar |
data-user-country |
Country code (e.g. GB) — shown in Customer Information sidebar |
data-custom-data |
JSON array of ["Label", "Value"] pairs for any extra data — shown in Custom Data sidebar section |
How the data is used
- Name and email pre-fill the chat start form so the customer doesn't have to type them.
- Email is used to match an existing Ticaga account — if a match is found, the chat session is linked to that user automatically.
- ID code is matched against billing accounts (Blesta, WHMCS, etc.) when a billing integration is configured on the widget.
- All fields appear in the Customer Details panel visible to the agent during and after the chat.
- Custom fields appear as additional rows at the bottom of the Customer Details panel.
Important: data is read once at page load
The widget reads identity data once when the script initialises. It is not updated dynamically after the page has loaded. If you push to window.TicagaChat after the widget script has already run, those calls are silently ignored.
For single-page applications where the user may log in without a full page reload, ensure the queue script is rendered with fresh data before the widget script loads, or trigger a full page reload after authentication so the widget reinitialises with the correct identity.