Integrating with Google Analytics

Follow

You can integrate your landing pages with Google Analytics by using one of two methods.

1) Integrating across a domain using Script Manager or

2) Integrating your landing pages manually.

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

Pro-tip

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


Integrating Landing Page Domains with Google Analytics (through Script Manager)

Step One: Get Your Website Tracking ID from Google Analytics.

Step Two: Enter your Website Tracking ID in Script Manager:

  1. Under Settings, click “Script Manager”. Click "Add your first script" and select “Google Analytics” from the drop-down menu.
  2. Enter your Website Tracking ID (found in Google Analytics) then click "Add Script Details"
  3. 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.
  4. 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 
  1. 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.
  2. Return to Unbounce and paste the tracking code into your landing page's Javascript library Select 'Head' for placement.
  3. If using a Form Confirmation Dialog, paste the tracking code into your confirmation dialog as well and select 'Head' for placement.
  4. 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.

Pro-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:

  1. Navigate to Admin, then open Goals
  2. Set up a new Goal
  3. Select Destination (under type) and then use one of the following regular expressions:

a) /.+-form_confirmation\.html

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"

c) ^/.+-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".

standardsmall.png

 


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.

    1. Click "Javascripts" from the Page Builder.
    2. Copy the following javascript customization:
    3. In the Unbounce Page Builder, paste the customization into your javascript, select "Before Body End Tag" or "After Body Tag" from the Placement drop-down menu.
    4. Click "Save Code" and repeat this for every page desired.

Further information on Goals in Google Analytics:


Next Steps

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.


Glossary

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.


About_The_Author.png

furth

Was this article helpful?
52 out of 63 found this helpful