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:
- In your GA4 property, click on ‘Data Streams’ in the ‘Property’ column of the ‘Admin’ section.
- 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.
- In the ‘Data Stream Details‘, you will find your ‘Measurement ID’ right under the data stream name. It will look something like ‘G-XXXXXXXXXX’.
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.
- From the “Data Stream Details” screen, select the “Measurement Protocol API secrets” link. This will take you to the secrets list screen.
- Click “Create” on the secrets list screen.
- In the “Create new API secret” window, assign a nickname to your secret key, and then click “Create“.
- Your new secret key will now appear on the secrets list screen. Be sure to copy and store it securely.
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.
- In your WordPress dashboard, hop over to the Forms → Integrations screen.
- Scroll over to the “Google Analytics 4” and add in your Measurement ID and API secret key.
- Click the “Save Changes” button and wait for the confirmation that it’s saved.
- Next, go to the Forms → All Forms screen and edit your form.
- From the form builder, go over to the “Setup” tab.
- Make sure to turn on “Use Google Analytics“, then click “Update“.
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!