Google Analytics is a free and powerful platform that provides statistics and analytical tools. You can integrate your landing page with Google Analytics via gtag.js (global site tag) installed as a custom JavaScript. This guide will show you how to integrate your landing page via a tracking code created for a Universal Analytics property.

Lately, Google has launched new Google Analytics 4, however, the new version doesn’t support goals with conversion tracking from form submission yet. If you use GA4, you can create a Universal Analytics property (steps below) or track conversion with Google Tag Manager.

If you use Universal Google Analytics, you can skip the first section and head to Install your tracking code.

(GA4 only) Create a universal property

  1. Log in to your Google Analytics account, go to Settings > Admin, and select Create Property.
  1. Name the property and select Show advanced options at the bottom.
  1. Use the toggle to create a universal property. Paste the URL of your landing page. You can create two properties at the same time – Universal and GA4, or only the Universal one.
  1. If you select Create both, you can create a goal to track form submission only for the Universal property (1). The GA4 property is marked with GA4 at the end (2).

You can install more than one global tracking code for one landing page/URL. For example, you can track conversion from form submission using the Universal property, and track other events using the GA4 property. You just need to switch between properties in Analytics to see the metrics.

Install your tracking code

  1. Log in to your Google Analytics account, go to Settings and Admin.
  1. You need to create a property for your subdomain. Click on Create Property and paste the URL of your landing page. Now, you can navigate to Tracking Info and select Tracking Code.
  1. Copy your Global Site Tag (gtag.js).
  1. Log in to Smartpages. Go to the Dashboard of your landing page, select JavaScript Codes and add a new script.

You can also access the Dashboard and the JavaScript Codes tab directly from the editor.

  1. Type a name and paste the snippet in the Content field. Select Head for both pages and click Add.

GA will be tracking data on your landing page immediately after adding the tag. You’ll see complete data in GA reports after about 24 hours, but active users on the landing page are visible in the Real-time tab. You can verify the code on your landing page using Google Tag Assistant.

Adding the gtag.js is just the first step to fully take advantage of Google Analytics. You can track conversion (see below), track button events, or track other events.

Read our blog post on How to use GA with landing pages.

Track conversion (form submission)

To track the conversion rate on your landing page in GA, you need to add and configure a goal in GA. It’s best to track conversions on the thank you page.

  1. Log in to your Google Analytics account and go to Admin tab > Goals. Click + NEW GOAL to create a new goal.
  1. In the Goal description, name your goal and select Destination. Click on Continue.
  1. In Goal details, select Begins with from the drop-down menu. If you use the default thank you page with the dynamic URL (changing hash), enter the empty field as Replace our example with your URL. Finally, click Save.

NOTE: If you have your own custom thank you page, select Equal to from the drop-down menu and paste the URL.

Go ahead and submit a form to verify whether the tracking tag and goal work as it supposed to.

You can access the data in Conversions > Goals.

You can switch between your properties anytime.

Was this article helpful to you?


Comments are closed.