Custom Variable is an advanced feature in Comm100 Live Chat that enables you to read visitor information from your website and pass it to your live chat system. This enables you to know visitors’ identity without asking, learn their specific behaviors on the website and identify target visitors. You can proactively invite target visitors to chat, provide personalized chat service and improve chat efficiency.
Technically, Comm100 Live Chat Custom Variable uses HTML Document Object Model (DOM) or JavaScript variables to read information on your website. To utilize custom variables, you need to have that content/information on your website already, and then specify the DOM or JavaScript variable expression in Comm100 Live Chat to read that content/information to your chat console.
You can locate the DOM elements using a set of selectors, such as ID, tag name and class. For example, if you have visitor’s name on your website defined by ID, the expression you need to set in Comm100 Live Chat would be document.getElementById(‘visitor-name’).innerText.
If your visitors’ information is defined by JavaScript variables, the expression should be set according to your own JavaScript variables. For example, you have a JavaScript variable on your website telling your visitors’ email:
In such case, you can set the expression in your Comm100 Live Chat control panel accordingly as MyCompany _Variable_Email.
After you successfully set up custom variables in your Comm100 Live Chat account, content/information of the custom variables’ expressions will be captured and passed to Comm100 Live Chat.
You can retrieve the values from the dedicated Chat Window URL which is not JavaScript based. Read more info on How to set Custom Variable Value?
Note: If you choose the Text type, the value must be placed inside single quotations (i.e. ‘some-input’)