Launch a feature in Engagement Messenger using custom code
Use the custom code to enable the deep linking and launch a feature in Engagement Messenger integrated with your website.
始める前に
Configure Engagement Messenger.
Embed Engagement Messenger in your web application.
Role required: ec_admin and website administrator
このタスクについて
注:
If you’re using existing code, verify that you update the script to show v=3.1. For example:
<script src="https://example.service-now.com/scripts/sn_csm_ec.js?v=3.1"></script>
<script>
SN_CSM_EC.init({
moduleID: "https://example.service-now.com/#aeff0547dd393010f87734cef087e2ba",
loadFeature: SN_CSM_EC.loadEMFeature()
});
</script>手順
タスクの結果
例
The following code initiates the chat feature by default. It also shows how to trigger a Virtual Agent topic by default when chat is loaded by passing the system identifier (sys_id) of the topic. You can also specify a language to initiate chat in that language.
<script src="https://example.servicenow.com/scripts/sn_csm_ec.js?v=3.1"></script>
<script>
function chatFeatureContext(){
return {
feature: "CHAT",
openOnLoad: false,
params: {
"topic_id": "8708db281bd5b81080df6247b04bcb79",
"language": "fr"
}
}
}
SN_CSM_EC.init({
moduleID: "https://example.service-now.com/#d27c94d6db403810a2a6a0ced39619da",
loadFeature: chatFeatureContext()
});
</script>
- function
- chatFeatureContext(): The wrapper function for chat context.
- feature
- CHAT: The chat feature for initiating Virtual Agent or Live Agent chat.
- openOnLoad
- false: Disable the automatic launch of Engagement Messenger.
- topic_id
- 8708db281bd5b81080df6247b04bcb79: The module system identifier (sys_id).
- language
- fr: Sets the default chat language to French.