This document explains the questions about JavaScript SDK(”SDK” below).
How to distinguish a member and a non-member
The SDK distinguishes a member user and an unknown user(non-member) based on whether to set memberId to boot option when boot.
See boot for more details.
How to set a user’s profile without a user’s behavior
See the boot code for a member user in boot.
How to set the position of a channel button
Set the position of a channel button at Channel settings > General > Manage Plug-in > Web Plugin Setting of the desk.
How to change the image of a channel button
Set the image of a channel button at Channel settings > General > Manage Plug-in > Web Plugin Setting of the desk.
How to use the HTML elements as the channel button
See how to customize channel button.
How to select HTML elements in SDK by CSS Selector
The SDK doesn’t provide CSS selectors to select the HTML elements like the channel button, the messenger, etc.
Don’t use the id and class of the HTML elements of SDK as the CSS selector.
These values are subject to change without a notice.
channel buttons, messengers, etc. are hidden behind certain elements of the website
By setting zIndex of boot option, you can change z-index of the HTML elements.
How to Use the Support Bot and Marketing Features in an SPA Environment
In an SPA environment, the SDK and Channel Talk server cannot automatically detect changes to the URL. To properly leverage the support bot and marketing features, you need to use the setPage and track methods together.
When the URL of the web application changes, follow the steps below:
- Use setPage to update the current page information in the SDK.
ChannelIO('setPage', 'CURRENT_PAGE');
- Use track to send a
PageView
event. This event includes the current page information set by the setPage.
ChannelIO('track', 'PageView');
By following this process, the SDK and Channel Talk server can accurately recognize the user's current page location and provide appropriate marketing messages and a support bot.
For more detailed information about events and pages, please refer to What is an Event, What is a page.
Updated about 1 month ago