Special offer: save $60 today

Documentation»Integrations»Google Analytics 4 integration

Google Analytics 4 integration

2 minute read

Happyforms uses the Google Analytics Measurement Protocol to track analytics data of your forms’ activities.

The introduction of Google Analytics 4 (GA4) brought a series of changes to the Measure Protocol API, and it now uses a different data model than Universal Analytics. GA4 focuses more on event-driven data rather than sessions or pageviews, enabling a more refined understanding of user interaction.

Create a Google Analytics 4 property

First things first, you need to have a GA4 property set up. If you already have a Universal Analytics property, you can upgrade it to GA4, or you can create a new GA4 property.

To create a new GA4 property, follow the steps outlined here.

Find your Measurement ID

Once you have a GA4 property, the next step is to obtain your GA4 Measurement ID. This ID uniquely identifies the data stream your event data should be associated with when sent via the Measurement Protocol.

Here’s how you can find your GA4 Measurement ID:

  1. In your GA4 property, click on ‘Data Streams’ in the ‘Property’ column of the ‘Admin’ section.
Google Analytics 4 property data stream link
  1. Select the Web data stream you want to send event data to. if you don’t have any data stream yet, create a new Web stream.
Google Analytics 4 property data stream list
  1. In the ‘Data Stream Details‘, you will find your ‘Measurement ID’ right under the data stream name. It will look something like ‘G-XXXXXXXXXX’.
GA4 Measurement ID

It’s important to keep this Measurement ID confidential and secure, as anyone with it could potentially send data to your GA4 property.

Find your API secret key

The next step is to generate an API secret key. And to do this, you need to create API secrets.

  1. From the “Data Stream Details” screen, select the “Measurement Protocol API secrets” link. This will take you to the secrets list screen.
GA4 data stream Measurement Protocol API secrets link
  1. Click “Create” on the secrets list screen.
Google Analytics 4 Measurement Protocol API secret screen list
  1. In the “Create new API secret” window, assign a nickname to your secret key, and then click “Create“.
Google Analytics 4 Measurement Protocol API create secret screen
  1. Your new secret key will now appear on the secrets list screen. Be sure to copy and store it securely.
Google Analytics 4 Measurement Protocol API secret value

Remember, this key is crucial as it enables data transmission to your Google Analytics account. Misuse could result in data corruption or loss, so treat it with confidentiality.

Connect Happyforms to GA4

Now that you have your Measurement ID and your API secret key, you can now connect your form to your Google Analytics 4 property so you can start collecting analytics data.

  1. In your WordPress dashboard, hop over to the FormsIntegrations screen.
  2. Scroll over to the “Google Analytics 4” and add in your Measurement ID and API secret key.
Happyforms Google Analytics 4 integration widget
  1. Click the “Save Changes” button and wait for the confirmation that it’s saved.
  2. Next, go to the FormsAll Forms screen and edit your form.
  3. From the form builder, go over to the “Setup” tab.
  4. Make sure to turn on “Use Google Analytics“, then click “Update“.
Happyforms Setup tab Google Analytics

And that’s it! Your form is now connected to your GA4 property.

Remember that the keys to this data kingdom must be kept secure. Any misuse of your Measurement ID or API secret key can lead to data corruption or loss. Please treat them with the confidentiality they require to maintain the integrity of your data.

Now that your form is successfully linked to your GA4 property, it’s time to tap into the powerful capabilities of GA4’s event-driven data model. Monitor, analyze, and adapt based on the valuable insights you garner. This is just the beginning of your journey towards enhanced data-driven decision-making with Google Analytics 4 and Happyforms. Happy data analyzing!