Loading
Salesforce now sends email only from verified domains. Read More
Service
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Create Channel Menu Code Settings

          Create Channel Menu Code Settings

          Add optional JavaScript code as a static resource to your channel menu to change the customer experience. Collect extra information in pre-chat or change the branding for your Enhanced Web Chat channel.

          Required Editions

          Important
          Important

          Channel Menu code snippets created before August 8, 2025 use legacy infrastructure that’s in maintenance mode and scheduled for retirement on July 1, 2026. If you’re using a code snippet generated before August 8, 2025, we recommend updating it to avoid future disruptions. Generate a new snippet from the Get Code section under the deployment settings for your existing Channel Menu deployment and update your webpage. Learn more in help.

          View supported editions.
          User Permissions Needed
          To set up a channel menu: Customize Application AND Modify Metadata
          To set up Code Settings: Author Apex

          Code settings, configured in your channel menu settings, are a useful way to modify menu items with static resource files. To change an image or pass routine information to pre-chat fields or to populate a hidden field, create static resource files and then upload them to Salesforce.

          Note
          Note Code modifications to WhatsApp, SMS text, or phone channels aren’t supported.

          Settings are applied first to your website or Experience Builder site from the Channel Menu component settings in the code snippet or Experience Builder. Next, they're applied from your uploaded JavaScript file and then from Setup.

          When a code setting is applied to your web or Experience Builder site, the related JavaScript file is loaded. You can associate multiple JavaScript static resources to different code settings, and load the configuration to a website or Experience Builder site.

          Step 1: Create a Snippet Settings File with JavaScript

          You can use your JavaScript static resource files, including strings, arrays, JSON, and JavaScript functions for the channel menu. To get started, follow this code example to modify a menu item for channel menu static resource files. Use these supported settings.

          Settings to Modify Setting Name
          (Enhanced Web Chat) Turn on Enhanced Web Chat developer mode to load unminified versions of static files and allow more logging to the developer console for troubleshooting. You can also access other Enhanced Web Chat APIs.

          Enhanced Web Chat channel settings:

          devMode

          (Chat) Pre-chat and entity creations: Add extra pre-chat information or populate form fields to prepare service reps for the customer conversation.

          Chat channel settings:

          prepopulatedPrechatFields

          extraPrechatInfo

          extraPrechatFormDetails

          (Chat) Branding: Customize your menu branding to maintain consistency and update changes easily.

          Chat channel settings:

          prechatBackgroundImgURL

          smallCompanyLogoImgURL

          waitingStateBackgroundImgURL

          chatbotAvatarImgURL

          avatarImgURL

          (Chat) Routing: Add routing to direct customer conversations to the right service rep.

          Chat channel settings:

          directToButtonRouting

          fallbackRouting

          Step 2: Upload Your Static Resource Files

          With your code ready, upload a file as a static resource in Setup.

          1. When you upload your file, select Public for the cache control.
          2. Choose a static resource name that’s easy to remember. Use this name and not the file name in your channel menu settings.

          Step 3: Add Resources to Code Settings

          Edit your code settings to link to your static resource file.

          1. From Setup, enter Channel Menu in the Quick Find box and select Channel Menu.
          2. Click the name of the channel menu you want to edit.
          3. In the Code Settings section, click Edit.
            Edit page for Channel Menu Code Settings.
          4. Select Add Code Setting.
          5. Enter a unique Code Setting Name for your customization.
            A screenshot of the code settings overlay with a Code Setting Name added.
          6. Add a description and select a resource type.
          7. Select your uploaded resource name in the Static Resource field.
          8. Select Add Code Setting to add more.
          9. Save your changes.

          Step 4: Implement Your Code Settings (Experience Builder Sites)

          Add your code setting name in the property editor and load the Code Setting Name for your site on a specific page.

          Screenshot of the property editor panel to add your Code Settings Name.

          Step 5: Implement Your Code Settings (Websites)

          Add your code setting name to your channel menu code snippet.

          1. Apply a channel menu code snippet if you haven't done so yet.
          2. Open the code snippet that you added to your website.
          3. Add the new parameter as an object to the embedded_svc.menu.init() call in the snippet. See the end of this section for an example.
          4. Check that the object is the last parameter passed into embedded_svc.menu.init().
          5. Verify that your code snippet changes in your web page markup.
          6. After 10 minutes, refresh your web page and confirm that the Channel Menu button appears. Check that the static resource is loaded and the item is working on the web page.

          Adding a parameter to your channel menu code snippet:

          embedded_svc.menu.init(
          	...existing parameters,
          	{
          		pageName: "InsertName"
          	}
          );
           
          Loading
          Salesforce Help | Article