Visitor Identification

Visitor Identification

Thanks to Visitor Identification, you'll be able to connect the data from your system with Tidio Chat.

Defining visitor data

To define visitor details while loading the page, you need to paste in the JavaScript code from below, just before the chat code. This will fetch the user details from your system and fill them in Tidio Chat.

document.tidioIdentify = {
    distinct_id: 'unique_id', // Unique visitor ID in your system
    email: 'contact@mail', // visitor email
    name: 'John Doe', // Visitor name
    phone: '+44 2032897807', //Visitor phone
};

This functionality can merge the conversations with the same visitor in the admin panel.

All fields are optional.

ParameterDescriptionFormat
distinct_idUnique ID in your System for visitor"string" or number
emailuser Email"string", email format required
nameVisitor name"string"
phonePhone number"string", area code required, format +44 2032897807

πŸ“˜

Info

If you identify your visitors via distinct_id it's advisable to consider implementing a more complex ID format, such as UUIDv4.

Updating visitor data

You can update visitor data only after the Tidio Chat code is loaded.

tidioChatApi.setVisitorData({
    email: '[email protected]',
    city: 'Denver',
    country: 'US',
    tags: ['tag1', 'tag2'],
});

This function won’t merge the conversations with the same visitor in the admin panel.

Remember! If the email defined in document.tidioIdentify will differ from the one triggered through tidioChatApi.setVisitorData, the system will replace the first one after refreshing the page.

You can use a separate function to add tags to your visitor. Adding the same tag twice will not duplicate it (tags work as a set - meaning the values are unique).

tidioChatApi.addVisitorTags(['tag1', 'tag2']);

Setting visitor currency

You can set the visitor currency only after the Tidio Chat code has been loaded.

tidioChatApi.setVisitorCurrency({
    code: 'EUR',
    exchangeRate: 1.25
});

This function allows you to associate currency preferences with the visitor. It can be used for personalized pricing and transactional features.
It is a part of the Product Recommendations feature, which adds your products database as a data source for Lyro AI Agent.

If you're using Product Recommendations with the native Shopify integration, you don't need to set the currency manually-this works out of the box on Shopify stores.

If you're using the OpenAPI integration and your store supports multiple currencies, you can define the visitor's currency using this function.

πŸ“˜

Info

Setting a visitor's currency is not necessary if your store operates with a single default currency.

ParameterDescriptionFormat
codecurrency code (e.g., USD, EUR, GBP)"string"
exchangeRateDecimal value relative to your base currency"number"

Both fields are required.

How is price calculated?

updated_price = round(price * currency_rate, 2)

Example:

  • Your base currency is USD
  • The visitor's currency is GBP
  • you have a product that costs 20 USD or 14.80 GBP

This means your exchange rate is 0.74 (1 USD === 0.74 GBP).

tidioChatApi.setVisitorCurrency({
    code: 'GBP',
    exchangeRate: 0.74
});