You can integrate your landing pages with Google Analytics by using one of two methods.
If you're looking to integrate Popups or Stickybars with event tracking in Google Analytics, head on over to: Integrating Popups and Stickybars with Event Tracking in Google Analytics.
What you will need
- A Google Analytics Account
- An Unbounce Account
- A working domain or subdomain
Before integrating with Google Analytics, please ensure that any Personally Identifiable Information (PII) is stripped out of the URL that Unbounce passes to Google Analytics, as per Google Policy. Check out Removing Personally Identifiable Information (PII) from Google Analytics for more information.
Integrating Landing Page Domains with Google Analytics (through Script Manager)
Step Two: Enter your Website Tracking ID in Script Manager:
- Under Settings, click “Script Manager”. Click "Add your first script" and select “Google Analytics” from the drop-down menu.
- Enter your Website Tracking ID (found in Google Analytics) then click "Add Script Details"
- Two boxes will open: "Script Details" and "Script Usage". In the "Script Usage" field, select which subdomain(s) you'd like to apply the Google Tracking Script to.
- Click "Save and Publish Script"
You've now integrated Google Analytics with the selected subdomain and its pages!
Manually Adding Individual Landing Pages with Google Analytics
As an alternative to the Script Manager option, it's possible to follow a manual method of integrating with Google Analytics on individual landing pages. This comes in handy with use cases that require customization to the Google Analytics script. Some examples are:
- Display feature tracking
- Custom dimensions
- Opting out of automated tracking
- Anonymize specific IP addresses in Google Analytics
To embed Google Analytics tracking on individual landing pages you need:
- A Google Analytics Account
- An Unbounce Account
- Select and copy your tracking code from your Google Analytics account. This is found under Admin > Select Account > Select Property > Tracking Info > Tracking Code. For detailed instruction check out Google's Guide on how to get your tracking code.
- If using a Form Confirmation Dialog, paste the tracking code into your confirmation dialog as well and select 'Head' for placement.
- Save and republish your page.
Google Analytics will track metrics for your landing pages immediately, but these will not display in reports for about 24 hours.
Tip: Active visitors on your page will be immediately visible in your 'Real-Time' reports. Full visitor data populates to the rest of the reports about 24 hours later. For this reason there is always an approximate 24 hours lag between stats collected in Unbounce and stats collected in GA.
Adding your Form Confirmation as a Conversion Goal in Google Analytics
Adding Goals in Google Analytics lets you track when you're hitting target objectives. If you're using the Unbounce form confirmation dialog (thank you page) and would like to track form submissions as a Goal in Google Analytics you can achieve that with a "regular expression."
Setting Your Google Analytics Conversion Goal Using "Regular Expression"
A regular expression allows Google Analytics to track each variant on your landing page without you having to create a new goal for each variant.
Head over to your Google Analytics account and follow these steps:
- Navigate to Admin, then open Goals
- Set up a new Goal
- Select Destination (under type) and then use one of the following regular expressions:
This will set a destination goal for all pages using a form confirmation dialog.
b) /landing page path/.+-form_confirmation\.html
If you want to narrow down the goal to an individual page, specify a more defined path before the regular expression.
For example, if my landing page lives at "try.mysite.com/landingpage", my regular expression would be "/landingpage/.+-form_confirmation\.html"
To track a goal for a page that lives at your root domain, use this regular expression.
For example, if my landing page lives at try.mysite.com, my regular expression would be "^/.+-form_confirmation\.html".
Removing Personally Identifiable Information (PII) from Google Analytics
You'll want to ensure that Personally Identifiable Information (PII) is removed from the URL that Unbounce passes to Google Analytics so that you don't run afoul of Google Policy. Please follow the steps below and be sure to test before starting your campaign to make sure PII is not making it to Google Analytics.
1. Retrieve the field name for any forms fields on your landing pages collecting PII (including email address, name, phone number, address). This is generally lower case with underlines for spaces.
- For instance, First Name becomes first_name. You can also check this from the Design Your Form dialog in the Unbounce landing page builder - it's located right below the field's display name:
2. Log into Google Analytics and head to Admin > View Settings.
3. Add any field names you are using to collect data across all your landing pages at the same domain under Exclude URL Query Parameters.
Further information on Goals in Google Analytics:
Customizing Google Analytics Event Tracking
Below is an example of the results that you would yield from this example landing page:
Follow the steps below to customize Google Analytics event tracking. Note that you will first have to have event tracking set up.
If you integrate your pages with Google Analytics using Script Manager, event tracking is automatically created in Google Analytics for action items on your page.
If you integrate your pages with Google Analytics manually, you will need to set up event tracking manually before you can customize. See Setting Up Event Tracking in Google Analytics for Google's handy instructions on how to do this.
- Click "Save Code" and repeat this for every page desired.
Referral Exclusion list
If you are tracking across subdomains (visitors on a.mydomain.com crossing over to b.mydomain.com) your traffics sources to 'b.mydomain.com' will show as being referred from 'a.mydomain.com'.
By default Google Analytics sees landing on a different subdomain as the start of a new session. To prevent this, add your Unbounce domain to your Google Analytics properties "Referral Exclusion List". This will track the visitor between these domains to the original source.
Customizing Your Reports
Data collected from this integration is handled within your Google Analytics account. Check Google's site for information on building customized reports.
Adding Goals in Google Analytics: Lets you track when you're hitting your target objectives.
Conversion goal: Enables Unbounce to track the success of your landing pages (e.g., a link or button clicked on the page or a form submission).
Google Analytics placement: Head.
Property: Site that you're working with.