您在此处:
渠道菜单的静态资源文件示例
创建 JavaScript 文件作为静态资源上载,并将其应用于渠道菜单网站或 Experience 站点。此代码示例填充聊天前设置,并添加公司徽标。
创建 JavaScript 文件作为静态资源上载,并将其应用于渠道菜单网站或 Experience 站点。此代码示例填充聊天前设置,并添加公司徽标。
| 查看支持版本。 |
| 所需用户权限 | |
|---|---|
| 创建和编辑静态资源: | 自定义应用程序和作者 Apex |
可使用 JavaScript 静态资源文件,其中包含字符串、数组、JSON 和 JS 函数,并可用于渠道菜单。要设置代码文件,使用此示例作为参考。
_snapinsSnippetSettingsFile。
window._snapinsSnippetSettingsFile = (function() {})();
embedded_svc.menu.snippetSettingsFile上存储设置,以在渠道菜单中合并。
window._snapinsSnippetSettingsFile = (function() {
console.log("Code settings file loaded");
// Chat menu-item specific settings
embedded_svc.menu.snippetSettingsFile = {
TestChatChannel: {
settings: {
prepopulatedPrechatFields: {"Subject":"Login Issue"},
smallCompanyLogoImgURL: "https://yourwebsite.here/company_logo.png"
}
}
};
})();
在示例代码中,TestChatChannel 是您唯一的渠道菜单项名称的占位符,因此请确保更新它。
当您的文件完成后,返回到嵌入式静态资源,获取静态资源上传说明。

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.