Pre-requisites
This article will demonstrate how to integrate Google Analytics 4 with Gravity Forms. Here are some pre-requisites.
- You have a self-hosted WordPress site
- You have a Gravity Forms license and are using Gravity Forms 2.5+
- You have Event Tracking for Gravity Forms (a third-party and free WordPress plugin) installed
- You have a Google Analytics 4 account
- You have a Google Tag Manager account
Introduction
Google Analytics v4 is the newest iteration of Google Analytics. It’s pretty, powerful, and documented. It’s the future of analytics.
Those coming from event tracking in Google Analytics 3 are used to sending events to Google Analytics in the form of events.
For the most part, in GA3, you’d send the following with events:
- Event category
- Event action
- Event label
- Event value
While you can still send these events in Google Analytics 4, it doesn’t use categories, actions, etc for conversions.
Within this article, I will demonstrate how to use Event Tracking for Gravity Forms and pass data to analytics using Google Tag Manager.
First, make sure you have Gravity Forms 2.5+ installed. After that, ensure Event Tracking for Gravity Forms is installed as well. I’ll walk you through the configuration.
Installation
Please refer to the video below for installation instructions.
Mentioned in the video are these tools for Google Chrome:
I also briefly go over Local Storage and UTM parameters.
Setting up Tag Manager
To set up Tag Manager, you’ll need to create within tag manager several DataLayer variables, an event trigger, and finally an event tag.
The datalayer variables sent to tag manager are:
- GFTrackCategory
- GFTrackAction
- GFTrackLabel
- GFTrackValue
- GFTrackSource
- GFTrackMedium
- GFTrackCampaign
- GFTrackTerm
- GFTrackContent
The event trigger is: GFTrackEvent
Please follow the following video on how to set up the DataLayer variables within Google Tag Manager.
Once you have the DataLayer variables set up, you’ll want to set up the Event Trigger. The event name is: GFTrackEvent
Covered within this video are Google Custom Events and how to retrieve your Google Analytics v4 property.
Finally in Part 5, I go over how to track the conversion in Google Analytics.
And that’s it. Please feel free to share or visit the YouTube playlist for all of the videos.
If you have any tips or questions, please comment below.
Next Steps
I will record a Part 6 of this video (tips welcome) with any corrections and/or recommendations on how to generate your conversion reports.
Developers
If you wish to use the measurement protocol instead of Tag Manager, it is available in alpha from Google. I have no plans to add the GA4 Measurement Protocol to the Event Tracking plugin because Tag Manager works so well for this.
I have yet to find a Developer-centric API, but GA4 does have a beta reporting API available.
Great tutorial, but here’s my issue: I would like to ensure that my tracking information is sent to both Google Analytics (classic version) and GA4 at the same time, while Google is slowly transiting from one version to the next.
is that doable?
Yes, just set up multiple tags in tag manager. One for ga4, and one for universal.
Hi Ronald,
I love your plugin and the tutorials are great. The GA4 form submission tracking is working for me, but I cannot see any of the custom variables like the label. I can only see gforms_submission. The parameter name dropdown under events is blank. I also looked under conversions.
I set everything up like you do in the video. Do you know what I am doing wrong?
Hi, you can trace the multi step compilation. At each step, push an event?
Yes, pagination is built in. Please see this link: https://mediaron.com/event-tracking-for-gravity-forms/#pagination
Thanks Ronald!
Is the same for ga4?
On Universal it works!
But I would like to use the same event on ga4.
Are you using tag manager? You can have multiple tags
This worked very well to keep GA3 and start GA4. Thank you!!
You’re very welcome!
Do we need to set up custom dimensions for each data layer variable attached to the form submit event?
Hi Anthony, can you please explain what you are trying to do?
Hi Ronald,
I followed your steps to measure a Gravity Forms contactform in GA4. This works fine, but: if I want to measure different forms, that is still a problem. How do I seperate the measurements from one another? Do I make a different trigger for every form?
I would separate them by label.
I have multiple forms. A Contact Form and a Quote Form. The videos are great and I appreciate them. Right now, if I fill out either of them, ga4 will show gforms_submission event for both of the different form submissions but I want to be able to see an event if someone fills out the contact form and different event if somsone fills out the quote form. How would I set this up? I’m having trouble differentiating between the two in gtm.
Can you use the label to differentiate the two?
i can! but am I able to track those two different labels as different conversions?
Hi Eric,
I don’t use labels. In stead I use a different trigger and a different tag for each form. In the trigger I separate one form from another by choosing “This trigger fires on –> Some Custom Events” and then:
DL – GFTrackCategory contains {unique category name from your form feed}
DL – GFTrackAction contains {unique action name from your form feed}
Thanks, I was just about to suggest multiple GA4 tags.
You all have helped me so much!! thank you!!
I have problems with GA4 and Pagination Tracking.
The GFTrackEvent is not firing when the user changes the form pages, only when the form is submitted.
Am i missing something?
The event name of gform_submission is showing up in the Realtime area (https://i.imgur.com/GKGiEsQ.png), but for some reason, it doesn’t show within the actual Events area (https://i.imgur.com/oubaoiC.png). Any ideas why not?
I also added the Conversion that you mentioned, and that’s not tracking anything either (https://i.imgur.com/PEpfGAq.png).
This has been set up for a few days now, and have received multiple form submissions.
Hi there, I have a problem tracking the value. Looks like the value is not pushed correctly to dataLayer. It displays a 0 value every time. Is there any solution to this?
Thank you in advance.
Getting this to work has been an absolute nightmare. GA4 is surely the most over-engineered and complicated software I’ve ever seen. For whatever reason I’m not seeing events firing within real time even though I have followed Gravity form documentation. I can’t believe how complicated this is, to track a simple form submission.
Same. It looks like GA4 is tracking form submissions on their own, even without this set up. But it would be nice if this actually worked as advertised, so we could set the event names and other attributes/variables. But it seems inconsistent and not reliable from what I’m seeing in GA4 stats and realtime.
Sounds like I need to update the video series. It’s just hard finding the time.
This has been super helpful thanks. Like a previous question, for setting up custom definitions in GA4, is it necessary to set up more than the event_action, event_category and event_label or will they automatically pull through with the tag information from GTM? Looking forward to seeing how this can be reported on, if that’s planned for the future video…
Hi Roland!
Amazing work!
I tried to find a way to pass the UTM parameters collected by your plugin into the form notification, as a merge tag. It appears that they are not listed as merge tags. Would this be possible to do?
Thank you!