Integrating Unbounce with Google Analytics 4 (GA4)


GA4 is Google's new tracking property designed to help you capture more information and insight into your page visitor's journey using event-based analytics. To learn more, see our handy FAQ.

On July 1st, 2023, Google will replace Universal Analytics (UA) properties with Google Analytics 4 (GA4). If you try creating a new property in Google Analytics (GA), a GA4 property will automatically be created. 

This integration works with Unbounce and supports both Classic and Smart Builder. This article will explain how to set up GA4 with Unbounce and how to view some of this event data in GA4's dashboard. 

What You'll Need

  • A Google Analytics Account with a GA4 tracking setup,
  • An Unbounce account with live landing pages,
  • A working domain or subdomain, 
  • A data stream in your GA4 property for your Unbounce landing page domain (be sure to select the Web option). 

Please note that our teams are equipped to support you with implementing and setting up GA4 with Unbounce. If you have any questions about the GA4 platform, custom reporting, or require more training in GA4, please contact Google's support team. 

Installing GA4 in Unbounce (using the built-in integration)

  1. Log in to Unbounce, and from the left-hand side menu, click Settings
  2. From the drop-down menu, select Script Manager
  3. Click the blue Add a Script button on the top-right-hand corner. 
  4. From the Add a Script window, select Google Analytics 4 from the drop-down menu. 
  5. Paste your GA4 tracking ID in the empty field (also known as a Measurement ID):
    GA4 measurement ID.
  6. Click Add Script Details. A new page will appear to enter more Script Details
  7. From the Script Usage tab, select the domain you want the GA4 tag to apply to (i.e., GA4 will collect analytics for these landing pages):
    Red arrow pointing to domain.
  8. Click Save and Publish.  

You're all set! You've now set up the GA4 integration with Unbounce pages. Data and page metrics will appear in Google Analytics 24 hours later. 

Installing GA4 in the Classic Builder (manual installation) 

Pro Tip:

In GA4, a customer can have multiple data streams per property, so you can integrate GA4 once in Unbounce without worrying about integrating it for every page. However, you still have the option to install GA4 manually on pages in the Classic Builder. 

To install GA4 manually within the Classic Builder, you'll need the default GA4 installation code.

If you want to track form submission events as well, you will need

  1.  The default GA4 installation code (installed to the head), and
  2. A custom code - shared below -  to track form submissions

The Javascripts widget in the Classic Builder is a great way to add custom scripts to individual pages. Here is how to add your GA4 script to Classic Builder pages:

  1. Navigate to your landing page in the Classic Builder. 
  2. Click the Javascriptsbutton at the bottom of the Classic Builder.
  3. Give your script a name, such as 'GA4 Tag', and set the Placement to Head.
  4. Paste the GA4 tag in the script field. It should look like this:
    GA4 tag script installed in JavaScript widget.

Optional: Capturing Form Submission events

To capture form submission events, you'll need to create a second custom script. To start, copy this script:

  1. Click the Add Script to this Variant to add a second script.
  2. Paste in the event tracking script, and set the placement to Before Body End Tag:
    Form submission tracking script installed in Javascripts widget.
  3. Click the blue Done button to add the script.

Be sure to Save and Republish your landing page.

Enabling Enhanced Measurements in Google Analytics

GA4 helps you capture actions on your page through events.

An event in GA4 refers to any interaction on your website, such as a page load, button click, video play, form submission, etc.

GA4 automatically captures events on your page by default. However, you can also adjust the settings in Google Analytics to capture more enhanced measurements. To do so, you must enable Enhanced Measurements in your Google Analytics 4 property data stream.

  1. In the Google Analytics platform, navigate to Admin -> Property -> Data Streams.
  2. Click on the data stream corresponding to your landing page.
  3. Toggle the Enhanced measurement button:
    Enhanced measurements in GA4.
  4. To adjust which events you want to measure, click the gear icon, and toggle the events from the Enhanced measurement window that appears:
    Toggle the radio buttons for the different enhanced measurement options in Google Analytics.

Some common events that you may want to track on your Unbounce pages are:

  • Page views
  • Scrolls
  • Outbound clicks
  • Form interactions
  • File downloads
  • Video engagement

Click the Save button at the top to finalize these changes. 

Tracking Page Views in GA4

Follow these steps to access your page view metrics in GA4. 

  1. In the Google Analytics platform, navigate to the Reports tab on the left-hand side.  
  2. Under the Life cycle heading, click the Engagement drop-down menu, then Pages and screens. Then, select a Page path option:
    Pages and screens reporting tab in Google Analytics.

Under the Page title tab, you might see the (not set) title:
Page title column in Pages and screens tab.

To remedy this and ensure that a clear page title appears in Google Analytics, update the Page Title metadata settings on your landing pages back in Unbounce. Then, Google Analytics will start collecting the page titles: 

Updating Page Settings & Metadata in Smart Builder 

Managing your Page Properties in the Classic Builder - The Title & Metadata Section 

Variant Tracking in GA4


At this time, automated variant tracking only works if you've set up the built-in GA4 integration. If you've set up your GA4 integration via Google Tag Manager (GTM), variant tracking is currently unavailable.

If you're running an A/B test, or have Smart Traffic enabled on your page, you may want more granular data to see how your page variants perform.

The Unbounce integration passes through a 'page_variant' event which contains the Unbounce page variant letter ('variant_id' in Google Analytics reports).

To view page variant reports, follow these steps.

  1. In the Google Analytics platform, navigate to the Reports tab on the left-hand side.
  2. Under the Life cycle heading, click the Engagement drop-down menu, then Events, and click on the 'page_variant' event:
  3. Select variant_id as the Parameter Name:
    Parameter name drop-down menu.

Note: This data will only show events within the last 30 minutes. 

Setting up Custom Reports in GA4 

Custom reports (also known as Explorations in GA4) provide with advanced reporting insights to help you segment data better. 

Explorations are a new feature introduced with Google Analytics 4, and there are many ways to mock-up reports to get insight into different metrics, segments, and dimensions.

To provide you with an example, we'll set up a custom report to track page variants. To start, we'll set up a Custom Dimension. This custom dimension will collect data about page variants only. 

  1. Navigate to the Admin page in Google Analytics. 
  2. Click Custom definitions,
  3. From the new tab that appears, click Create custom dimension.
    • Set the Scope to Event and,
    • Set the Event parameter to variant_id:
      New custom dimension tab in Google Analytics.
      • You can set the event parameter to another option depending on what focused dimensions you want to track. For this example, we'll use variant_id.
  4. Click Save to finalize these changes.

To set up a report with the newly created custom dimension,

  1. Navigate back to the Explore tab.
  2. Click Free Form to set up a report with the newly created custom dimension.
  3. Under the Dimensions section, click the plus sign to add the new dimension:
    Add a new custom dimension.
  4. Select the dimension you created from the Custom section:
    Select custom dimension created.

You can then drag the dimension under the rows or columns to add it to the chart.

If you see the (not set) value instead of a variant letter, that means the event came from a form confirmation dialog or a lightbox:
Custom report in Google Analytics.

Related Articles

GA4 and Universal Analytics (UA) FAQ

Integrating Popups & Sticky Bars with Event Tracking in Google Analytics (GA4)

Do you agree or disagree with this statement: This article helped me find the information I needed quickly and easily.

Select an option and leave us some feedback in the comments:

Strongly DisagreeDisagreeSomewhat DisagreeUndecidedSomewhat AgreeAgreeStrongly Agree

Measuring Customer Effort Score with Nicereply