Loading
Upcoming Mandatory Changes to Public Key Infrastructure (PKI)Read More
Salesforce Enforces New Security Requirements in Summer 2026Read More
Marketing Cloud Next
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
          Track Activity on External Sites

          Track Activity on External Sites

          Track visitor activities on web pages hosted outside of Salesforce, such as your company website. To protect the privacy of your site visitors, use a consent banner to collect consent to track. You’re responsible for complying with privacy laws and regulations applicable to your business.

          Required Editions

          • If you’re setting up external tracking for the first time, create a website connector, and then create embed code that you add to your external site.
          • If you've set up external tracking before Winter ‘26, update your external tracking configuration.
          • Create a consent banner in Salesforce CMS for tracking activity on your website.

          Create External Tracking Configuration

          First, create a website connector that collects activity data from your external site. Then, create the embed code to add to your external site and associate it with your website connector, a consent banner, and a campaign.

          Important
          Important In most cases, you can reuse the same website connector for multiple embed codes. However, if you’re a Data Cloud One user, create and use a unique website connector for each org that has web tracking enabled.
          1. Create a website connector.
            1. From Setup, in the Quick Find box, enter Web Tracking, and then select Website Connectors.
            2. Click New.
            3. Name the website connector and click Create.
          2. Create the embed code.
            1. From Setup, in the Quick Find box, enter Web Tracking, and then select Webpage Embed Codes.
            2. Click New.
            3. Name the embed code and select a website connector.
            4. In the Configure Tracking Settings section, click Select Banner.
            5. Select a banner and save your work.
            6. Select a campaign to associate with the engagement data.
            7. Click Create.
          3. To turn on data collection on your website, copy the embed code and add it to your website’s head tag.

          To track activity without collecting consent, don’t select a banner in Salesforce Setup. Instead, add this code snippet to your external website after the embed code:

          <script>
                  const consent = {
                      provider: "Salesforce Marketing Cloud",
                      purpose: "Tracking",
                      status: "Opt In"
                  };
          
                  SalesforceInteractions.init({
                      consents: [consent],
                  }).then(() => {
                      SalesforceInteractions.initSitemap({ pageTypes: [] });
                  });
          </script>

          Update External Tracking Configuration

          If you set up external tracking before Winter ‘26, update your external tracking configuration to access the latest feature updates. Copy the web tracking script, and replace the existing script on your website.

          Important
          Important If you don't see your connectors and you created them before Summer ’25, contact Salesforce Customer Support to regain access to your website connectors with required updates.
          1. From the Website Connectors page, configure your web tracking connector.
          2. Copy the embed code and replace the existing code in your webpage's head tag.
            Note
            Note For accurate reporting of your website data, replace the script on your website.
          3. Save your changes.
           
          Loading
          Salesforce Help | Article