Loading
Extend Salesforce with Clicks, Not Code
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 Your Salesforce Sites with Google Analytics

          Track Your Salesforce Sites with Google Analytics

          Salesforce Sites provides out-of-the-box integration with Google Analytics. To track the usage of your sites and site pages, use Google Analytics. You can track the number of visits, the number of page views, the average time spent on the site, and more.

          Required Editions

          Available in: both Salesforce Classic and Lightning Experience
          Available in: Developer, Enterprise, Performance, and Unlimited Editions
          User Permissions Needed
          To create and edit Salesforce Sites:

          Customize Application

          OR

          Create and Set Up Experiences

          Note
          Note The <site:googleAnalyticsTracking/> component only works on pages used in a Salesforce Site. Sites must be enabled for your organization and the Analytics Tracking Code field must be populated. To get a tracking code, go to the Google Analytics website.
          1. Sign up for an account at Google Analytics.
          2. Add a profile in Google Analytics and enter the domain or full URL for the site you want to track.
          3. Copy the Web Property ID from Google's tracking status information. Then paste that value into the Analytics Tracking Code field on the Site Edit page for the site that you want to track.
            The Web property ID starts with the letters UA followed by your account and profile numbers. For example, UA-9049246-2.
          4. Save your changes.
          5. To track the Visualforce pages associated with your site, enter the following tag in the site template for those pages, or in the individual pages themselves.
            <site:googleAnalyticsTracking/>

            For a page to be tracked, this tag is required either in the page or the associated page template. The default site template already contains the tag, so all pages that use that template are tracked—including certain default pages.

            Note
            Note Google recommends adding the component at the bottom of the page to avoid increasing page load time.
          6. Go to the Google Analytics site and follow their instructions for completing the process.
            After you sign up, it can take up to 24 hours before you see initial tracking results in Google Analytics.
          Tip
          Tip To track multiple sites separately, create separate profiles using the full site URLs and enter a different Web property ID in the Analytics Tracking Code field for each site.
           
          Loading
          Salesforce Help | Article