Published at: 2025-10-30
User Source Analysis
1. Feature Activation
Online Support → System Settings → Channel Configuration → User Source Analysis
picture coming soon:
2. Parameters
Configure the web plugin settings by adjusting the parameters below.
2.1 Configuration Methods
- Via script tag (example below):
html
<script
id="fs-im-script"
type="text/javascript"
src="https://crm.ceshi112.com/open/imchat/static/creat.js?&webImId=2447060116862665016&autoOpen=3000"
></script>
- Via global variable
FSImChatParams(lower priority than script method):
javascript
window.FSImChatParams = {
webImId: '2447060116862665016',
autoOpen: 3000,
serviceSessionParams: {}
}
2.2 Parameter Descriptions
| Parameter Name | Description | Example |
|---|---|---|
| autoOpen | Auto-opens the web plugin dialog after a specified delay (in milliseconds). | {autoOpen: 10000} |
| serviceSessionParams | Additional parameters attached to session messages for tracking user sources. | { serviceSessionParams: { search_word: 'xxx', // Search term key_word: 'xxx', // Keyword source_website: 'xxx', // Source website landing_page: 'xxx', // Landing page consult_page: 'xxx', // Inquiry page } } |
3. API Methods
| Method Name | Description | Parameters | Example |
|---|---|---|---|
| openChatDialog | Opens the web plugin dialog. | {} |
FSImChat.openChatDialog() |
| updateParams | Updates web plugin initialization parameters. | { serviceSessionParams // Additional message parameters } |
FSImChat.updateParams({ serviceSessionParams: { sessionId: 'XXXX' } }) |
4. Events
4.1 Event Listening
javascript
FSImChat.$on(FSImChat.EVENT.RECEIVE_MESSAGE)
4.2 Event Center: FSImChat.eventBus
| Method Name | Description | Parameters | Example |
|---|---|---|---|
| $on | Listens for events. | Param 1: Event name (see 4.3 Available Events) Param 2: Event handler function | FSImChat.$on(FSImChat.EVENT.RECEIVE_MESSAGE, (data) => {}) |
| $once | Listens for an event once. | Param 1: Event name (see 4.3 Available Events) Param 2: Event handler function | FSImChat.$once(FSImChat.EVENT.RECEIVE_MESSAGE, (data) => {}) |
| $off | Removes event listeners. | Param 1: Event name (see 4.3 Available Events) Param 2: Event handler function to remove (removes all if empty) | FSImChat.$off(FSImChat.EVENT.RECEIVE_MESSAGE) |
4.3 Available Events
| Event Name | Description | Parameter Values |
|---|---|---|
| IM_CHAT_READY | Web plugin initialization complete. | None |
| RECEIVE_MESSAGE | New message received. | { messageCount // Message count } |