Loading
Experience Cloud
Reduce Tab Switching in Agentforce Service Agent on Experience Cloud Sites

Reduce Tab Switching in Agentforce Service Agent on Experience Cloud Sites

Use your deployed Agentforce Service agent within an Experience Cloud site to keep conversations and relevant content in one place for site visitors. This script prevents links the agent provides in its responses from opening new browser tabs, keeping you in the same conversation window and reducing navigation so you can find solutions faster. This procedure focuses on configuring the Experience Cloud site to optimize the agent's behavior for a single-tab experience.

Required Editions

Available in: Salesforce Classic and Lightning Experience
Available in: Aura and LWR Experience Cloud Sites
Available in: Enhanced Chat with the Einstein for Service, Einstein Platform, Community, Community Plus, or Agentforce Service Agent add-on
Available in: Enterprise, Performance, Unlimited, and Developer Editions with Foundations or Agentforce 1 Editions. Access to some standard agent actions requires additional add-on licenses
User Permissions Needed
To create an Experience Cloud site: Create and Set Up Experiences AND View Setup and Configuration
To customize or publish an Experience Cloud site: Create and Set Up Experiences AND View Setup and Configuration AND be a member of the site OR View Setup and Configuration AND be a member of the site AND have appropriate role-based site access
To create and manage Agentforce Service agents: Create and Set Up Experiences AND View Setup and Configuration AND be a member of the site OR View Setup and Configuration AND be a member of the site AND have appropriate role-based site access
To set up this Enhanced Chat: Customize Application AND Modify Metadata Through Metadata API Function

Before you begin, make sure you've completed these steps:

  • An Enhanced Chat channel configured and integrated with your Agentforce Service agent.
  • An Experience Cloud site is active and accessible.
  • The Agentforce Service agent is built and ready for deployment.
  • The Enhanced Chat component is added to your Experience Cloud site using Experience Builder.
  • Knowledge is set up and configured, as the next step involves mapping data categories.

These steps connect your Agentforce Service agent to your Experience Cloud site and apply a script to ensure links open in the same tab.

  1. From Setup, in the Quick Find box, enter Digital Experiences, and select All Sites.
  2. Find your Experience Site, and then click Workspaces.
  3. In Experience Builder, confirm that the Enhanced Chat component is added to the builder page.
  4. In Experience Builder, confirm that the MIAW component is added to the builder page.
  5. Map the site’s configured data categories to the corresponding topics and actions in the Agentforce Service agent configuration.
  6. In Experience Builder, from Settings, select Advanced, and then select Edit Head Markup.

    Add this script to make sure that links in ASA responses open in the same tab.

    <script>
    window.addEventListener("onEmbeddedMessagingReady", () => {
    // Set the snippet setting to 'true' on 'onEmbeddedMessagingReady' event.
    embeddedservice_bootstrap.settings.shouldOpenLinksInSameTab = true;
    });
    </script>
    
    
  7. Publish your site.
 
Loading
Salesforce Help | Article