Published at: 2025-10-30
User Source Analysis
1. Feature Enablement
Online Customer Service -> System Settings -> Channel Configuration -> User Source Analysis
picture coming soon:
2. Parameters
You can configure the web chat widget by setting parameters.
2.1 Configuration Methods
- Via a script tag URL. Example:
<script
id="fs-im-script"
type="text/javascript"
src="https://crm.ceshi112.com/open/imchat/static/creat.js?&webImId=2447060116862665016&autoOpen=3000"
></script>
- Via the global variable FSImChatParams (lower priority than the script tag method). Example:
window.FSImChatParams = {
webImId: '2447060116862665016',
autoOpen: 3000,
serviceSessionParams: {}
}
2.2 Parameter Definitions
| Parameter | Description | Example |
| autoOpen | Delay before the web chat widget automatically opens; a number greater than 0, in milliseconds (Unit). | {autoOpen: 10000} |
| serviceSessionParams | Parameters attached to outgoing session messages; useful for tracking user source information. | { serviceSessionParams: {search_word: 'xxx', // search term key_word: 'xxx', // keyword source_website: 'xxx', // source website landing_page: 'xxx', // landing page consult_page: 'xxx', // consultation page} } |
3. API Methods
| Method | Purpose | Parameters | Example |
| openChatDialog | Open the web chat widget dialog | {} | FSImChat.openChatDialog() |
| updateParams | Update the widget initialization parameters | {serviceSessionParams // parameters attached to outgoing messages} | FSImChat.updateParams({ serviceSessionParams: { sessionId: 'XXXX' }}) |
4. Events
4.1 Event Listening
FSImChat.$on(FSImChat.EVENT.RECEIVE_MESSAGE)
4.2 Event Bus — FSImChat.eventBus
| Method | Purpose | Parameters | Example |
| $on | Register an event listener | Param 1: event name (see 4.3 Available Events) Param 2: event handler function | FSImChat.$on(FSImChat.EVENT.RECEIVE_MESSAGE, (data) => {}) |
| $once | Register a one-time event listener | Param 1: event name (see 4.3 Available Events) Param 2: event handler function | Param 2: event handler function FSImChat.$once(FSImChat.EVENT.RECEIVE_MESSAGE, (data) => {}) |
| $off | Remove an event listener | Param 1: event name (see 4.3 Available Events) Param 2: event handler to remove (omit to remove all handlers) | FSImChat.$off(FSImChat.EVENT.RECEIVE_MESSAGE) |
4.3 Available Events
| Event Name | Description | Payload |
| IM_CHAT_READY | The web chat widget has finished initializing | None |
| RECEIVE_MESSAGE | A new message was received | { messageCount // number of messages} |