---
schema_version: "1"
id: 8168413802b9272fe183eecfd2b44fd0ea89a81c8b5456ca639c431e8b505e00
title: Track Your Salesforce Sites with Google Analytics
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/sites_analytics_tracking_code.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.sites_analytics_tracking_code.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: be16969194a83f5801e91717e95edc42c38a2dc84b7fc029ac1cd3b78941c3b2
description: 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.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# 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

<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: both Salesforce Classic and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Developer</strong>, <strong>Enterprise</strong>, <strong>Performance</strong>, and <strong>Unlimited</strong> Editions</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="d99264e72">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d99264e72 ">To create and edit Salesforce Sites:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d99264e72 ">
              <p>Customize Application</p>
              <p>OR</p>
              <p style="margin-bottom:0;">Create and Set Up
                Experiences</p>
            </td>

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

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_note.png)

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](http://www.google.com/analytics/) website.

1. Sign up for an account at [Google Analytics](http://www.google.com/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.
    
    ```markup
    <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](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_note.png)
    
    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](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_click-264-0-0-production-enus/5f7d9219-b7b1-4552-8891-f1aba9b289fc/images/icon_tip.png)

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.

#### See Also

- [Manage Salesforce Sites](https://help.salesforce.com/s/articleView?id=platform.sites_managing_sites.htm&release=264.0.0&type=5 "Review the high-level steps to create and manage a Salesforce Site.")
- [Create and Edit Salesforce Sites](https://help.salesforce.com/s/articleView?id=platform.sites_creating_and_editing_sites.htm&release=264.0.0&type=5 "After you enable Salesforce Sites, create a Salesforce Site. Or, update an existing site.")
- [Report on Salesforce Sites](https://help.salesforce.com/s/articleView?id=platform.sites_analytics.htm&release=264.0.0&type=5 "To track your site activity and usage, take advantage of the Sites Usage Reporting managed package. To help you avoid reaching monthly and daily limits for individual sites and for your org, this package includes site usage reports. You can use those reports to you analyze your monthly page views, daily bandwidth, and daily service request time.")