Notes:
Before you begin
Obtain a Google Analytics Tracking Code
-
You will first need to create an account for the following or login if you have an existing account:
Note: if you’ve previously set up a Google Analytics Account, you should configure a new Property for your Online Application site.
-
Google Analytics
- Google Analytics is a free web analytics tool offered by Google to help you analyze your website traffic.
-
Google Tag Manager
-
Google Tag Manager allows you to easily update tags and code snippets on your website. Once the Tag Manager snippet has been added to your website or mobile app, you can configure tags via Google Tag Manager without having to alter and deploy additional code.
- Note: Google Tag Manager is ONLY needed for the Online Application setup. For all other setups you will use the Google Analytics Tracking code.
- Locate your Tracking code in Google Analytics:
- Select

- Click Tracking Info
- Click Tracking Code
-
Copy the code and store it for later use.
Step 1: Update your Community Template
- Ensure that your sandbox has been refreshed before continuing.
- Login to your sandbox.
- Navigate to your Community Theme tab.
- Click the Theme Name for the Community you wish to track.
- Make note of the Template Name and store it for later use.
- Navigate to Setup and search for Visualforce Pages.
- Locate the page that was listed as your Template Name.
- Select Edit.
- Scroll to the end of the code and paste your Google Analytics tracking code BEFORE the last </body>:

Note: You must change the beginning of the following line in your Global Site tag from:
<script async src=...
To this:
<script async='async' src=...
-
Save your changes.
Step 2: Test the changes in your Sandbox
- Login to your Community using an existing test user.
- Verify they can create an Appointment, Interview, etc.
- Test any additional processes that are important to your institution.
- Verify that data is displaying in Google Analytics 'Real-Time.'
Step 3: Create and Deploy a Change Set
1. Create an Outbound Change Set 
- Navigate to Setup and search for Outbound Change Sets.
- Select New.
- Name the Change Set, for example: Online Application Analytics.
- Add a Description and Save your changes.
- In the Change Set Components section, select Add.
- Select a Component Type of Visualforce Page.
- Click the checkboxes for the Visualforce pages you updated in the previous steps.
2. Upload your Change Set
- From the Change Set you created above, select the Org you want to send the Change Set to.
- Click Upload.
Note: uploading the Change Set will send it to the Target Org; it will NOT make changes in your Production Org until you Deploy the Change Set.
3. Validate the Change Set in your Production Org
- Login to your Production Org.
- Navigate to Setup and search for Inbound Change Sets.
- The Change Set you uploaded should be available under Change Sets Awaiting Deployment.
- Click the Change Set you want to deploy.
- Click Validate.
4. Deploy the Change Set in your Production Org
- Login to your Production Org.
- Navigate to Setup and search for Inbound Change Sets.
- The Change Set you uploaded should be available under Change Sets Awaiting Deployment.
- Click the Change Set you want to deploy.
- Click Deploy.
For additional information on deploying Change Sets, please see Salesforce Help & Training article "Deploying a Change Set"