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

  1. 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>

  1. Via the global variable FSImChatParams (lower priority than the script tag method). Example:

window.FSImChatParams = { webImId: '2447060116862665016', autoOpen: 3000, serviceSessionParams: {} }

2.2 Parameter Definitions

ParameterDescriptionExample
autoOpenDelay before the web chat widget automatically opens; a number greater than 0, in milliseconds (Unit).{autoOpen: 10000}
serviceSessionParamsParameters 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

MethodPurposeParametersExample
openChatDialogOpen the web chat widget dialog{}FSImChat.openChatDialog()
updateParamsUpdate 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

MethodPurposeParametersExample
$on Register an event listenerParam 1: event name (see 4.3 Available Events) Param 2: event handler functionFSImChat.$on(FSImChat.EVENT.RECEIVE_MESSAGE, (data) => {})
$onceRegister a one-time event listenerParam 1: event name (see 4.3 Available Events) Param 2: event handler functionParam 2: event handler function FSImChat.$once(FSImChat.EVENT.RECEIVE_MESSAGE, (data) => {})
$offRemove an event listenerParam 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 NameDescriptionPayload
IM_CHAT_READYThe web chat widget has finished initializingNone
RECEIVE_MESSAGEA new message was received{ messageCount  // number of messages}
Submit Feedback