Event Tracking with Gravity Forms and Google Analytics 4

Google Analytics 4 Illustration
License: Adobe Stock

Pre-requisites

This article will demonstrate how to integrate Google Analytics 4 with Gravity Forms. Here are some pre-requisites.

  1. You have a self-hosted WordPress site
  2. You have a Gravity Forms license and are using Gravity Forms 2.5+
  3. You have Event Tracking for Gravity Forms (a third-party and free WordPress plugin) installed
  4. You have a Google Analytics 4 account
  5. 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:

  1. Tag Assistant
  2. Dataslayer
  3. Campaign Builder

I also briefly go over Local Storage and UTM parameters.

Event Tracking Integration with Google Analytics 4 (Part 1)

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.

Event Tracking with Google Analytics 4 (Part 2)

Once you have the DataLayer variables set up, you’ll want to set up the Event Trigger. The event name is: GFTrackEvent

Event Tracking with Google Analytics 4 (Part 3)

Covered within this video are Google Custom Events and how to retrieve your Google Analytics v4 property.

Event Tracking with Google Analytics 4 (Part 4)

Finally in Part 5, I go over how to track the conversion in Google Analytics.

Event Tracking with Google Analytics 4 (Part 5)

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.

Ronald Huereca
Ronald Huereca

Ronald Huereca

Ronald has been part of the WordPress community since 2006, starting off writing and eventually diving into WordPress plugin development and writing tutorials and opinionated pieces.

No stranger to controversy and opinionated takes on tough topics, Ronald writes honestly when he covers a topic.

2 thoughts on “Event Tracking with Gravity Forms and Google Analytics 4”

  1. 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?

    Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Ronald Huereca
MediaRon - Ronald Huereca

Ronald created MediaRon in 2011 and has more than fifteen years of releasing free and paid WordPress plugins.