Loading
Experience Cloud
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 User Engagement with Google Analytics 4

          Track User Engagement with Google Analytics 4

          For insights into page visits and user engagement, add Google Analytics 4 to your enhanced LWR site from Experience Builder.

          Required Editions

          Available in: Salesforce Classic and Lightning Experience
          Available in: Enterprise, Performance, Unlimited, and Developer Editions
          Applies to: LWR sites
          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

          If you don’t have a Google Analytics account, refer to the GA4 documentation from Google to set one up. You must create a GA4 property with a Web data stream.

          Google Analytics 4 allows users to track specific user interactions with page content. These interactions are called events. The out-of-the-box integration tracks certain events, including:

          • Page views
          • Scrolling
          • File downloads
          • Outbound clicks, which occur when a visitor selects a link that takes them to a separate domain.

          If you want to track other events, you can develop your own using custom events. For more information about events, see [GA4] Enhanced Measurement Events.

          1. In Experience Builder, go to Settings and select Integrations.
          2. For Google Analytics 4, click Add to Site.
          3. Enter your Google Analytics Measurement ID, and save the change.
          4. Publish the site. Google Analytics begins tracking user engagement after you publish.

          To stop Google Analytics from tracking user engagement, you can remove it from the site. Existing data for the site is still available in your Google Analytics account.

          You can also change the Google Analytics Measurement ID. On the Integrations page, click Edit for Google Analytics 4, and enter a different Measurement ID. Then publish the site.

          Note
          Note

          For testing purposes, you can publish the site from a sandbox or Developer Edition org. However, we recommend that you wait until you can deploy your site to production before you make it available to the public.

           
          Loading
          Salesforce Help | Article