---
schema_version: "1"
id: 0770a29b3e305eb1567411f3eca458fc6f610b9acffa527c36686e47adf14e50
title: Reduce Tab Switching in Agentforce Service Agent on Experience Cloud Sites
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/experience/264-0-0/support_set_up_bidirectional_capability.md
canonical_url: https://help.salesforce.com/s/articleView?id=experience.support_set_up_bidirectional_capability.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 2a59c4d70d03678b59338b4e56e28134fb046d083bf653b35861db9d16912ea7
description: 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.
products:
  - Experiences
release: "264"
---
# 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

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Salesforce Classic and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Aura and LWR Experience Cloud Sites</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Enhanced Chat with the Einstein for Service, Einstein Platform, Community, Community Plus, or Agentforce Service Agent add-on</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Enterprise, Performance, Unlimited, and Developer Editions with Foundations or Agentforce 1 Editions. Access to some standard agent actions requires <a href="https://www.salesforce.com/agentforce/pricing/" target="_blank">additional add-on licenses</a></td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d19233e76">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d19233e76 ">To create an Experience Cloud site:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d19233e76 ">Create and Set Up Experiences AND View Setup and Configuration</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d19233e76 ">To customize or publish an Experience Cloud site:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d19233e76 ">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</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d19233e76 ">To create and manage Agentforce Service agents: </td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d19233e76 ">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 <a href="https://help.salesforce.com/s/articleView?id=experience.networks_access_control_overview.htm&amp;language=en_US&amp;type=5" target="_blank">role-based site access </a></td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d19233e76 ">To set up this Enhanced Chat:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d19233e76 ">Customize Application AND Modify Metadata Through Metadata API Function</td>

          </tr>
        </tbody>
      </table>

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.
    
    ```java
    <script>
    window.addEventListener("onEmbeddedMessagingReady", () => {
    // Set the snippet setting to 'true' on 'onEmbeddedMessagingReady' event.
    embeddedservice_bootstrap.settings.shouldOpenLinksInSameTab = true;
    });
    </script>
    
    ```
7. **Publish** your site.

#### See Also

- [Configure Your Agent](https://help.salesforce.com/s/articleView?id=ai.agent_parent_configure.htm&type=5&language=en_US)
- [Quickly Set Up Enhanced Chat for Testing](https://help.salesforce.com/s/articleView?id=service.miaw_setup_stages.htm&type=5&language=en_US)
- [Create and Send Enhanced Links in Messaging Sessions](https://help.salesforce.com/s/articleView?id=service.messaging_components_enhanced_link.htm&type=5&language=en_US)