Get access to free tutorials, exclusive content and more.

Google Analytics Event Tracking for WordPress Form Submissions

Want to track WordPress form submissions in Google Analytics? Need an option for Google Tag Manager compatibility? We’re happy to now offer native Google Analytics 4 event tracking for WordPress form submissions!

There are a mountain of plugins and how-to articles that claim to make event tracking for WordPress forms easy. Some of them want you to buy into this insights plugin or the other. Others offer code that they’ve maybe made work for them, but good luck getting that set up manually.

If you just need a solution that actually works for registering a new form submission as an event in Google Analytics 4, this is it. It does not matter if you’re connecting straight to GA4 or through Google Tag Manager (GTM). Read on to find out how easy it is with Ninja Forms 🙂

One step setup for Google Analytics event tracking

Please note: this assumes that your site is already connected to Google Analytics 4. The form action described below does not create a new Google Analytics integration. It only registers form submissions as events in GA4. If your site does not already pass data to an existing GA4 account / property, we strongly recommend the Site Kit by Google plugin. It’s a very easy to use, no code method that takes maybe 5 minutes to get set up. 

Ninja Forms now includes a native Google Analytics 4 form action. It’s available for free in the core Ninja Forms plugin and can be found under Emails & Actions in the builder:

image of the Google Analytics 4 action available in the actions window after clicking Add New Action on the Emails and Actions tab of the builder.

Here’s how simple it is to use:

  1. Click to add the action, click again to open the actions settings window.
  2. In the settings window, name your Event.
  3. Save your form and move on with your day.

Google Analytics action settings window with Event named "PayPal Form Submission"

Each time this form is submitted, it will register an event in GA4 with the name you enter into the action. Your new event should be logged under Reports > Realtime pretty soon after submission and stay there for ~30 minutes. For events to populate outside of Realtime, you’ll need to give Google a little longer runway — several hours usually. But once you see the event register in Realtime, you know you’re up and running with event tracking for WordPress form submissions!

Tracking form submissions with Google Tag Manager

If you’re a GTM user, configuring the action itself is no different that the above. Just add the action to the form, toggle the action to GTM, and name your Event as you want it to appear in GA4.

You will have to take one additional step: configuring a Tag to snag the event from the data layer. The action will push the event to the datalayer, but as with all things GTM, you need a Tag to catch it (a GTM <> Pokémon, crossover could be kinda neat).

Exact Tag and Trigger configuration details can be found in our GA4 action documentation. It’s no different than setting up most other basic tags though. You’ll want a GA4 Event Tag with your Measurement ID. Assign it a {{Custom Event Name}} variable. Set a Trigger to fire on a Custom Event that matches the name you gave it in the form action. Done.

image of tag and trigger configuration in Google Tag Manager that enables google analytics event tracking

Bonus: set your form submission event as a Key Event (conversion goal) in GA4

If you want to track your form submission event as a Key Event / conversion goal, it’s pretty simple. But dicey to find sometimes. So to save you the search I inevitably have to make any time I want to do this:

  1. In GA4, click the admin gear bottom left of page
  2. Under Property Settings, expand Data Display, click Events
  3. Under Recent Events or via the search bar, locate your new form submission event (events only registered in Realtime may not be present here yet)
  4. Click the star next to your event name

That’s it, you’re tracking form submissions in GA4!

It’s really simple by design. So many tried and true custom solutions were floating around in the Universal Analytics days, it was hard to justify spending time making an official integration. But the move to GA4 made all of those obsolete. It started to become a pain for us to track our own forms, so we knew others had to be wrestling with it too. And so… the new Google Analytics 4 form submission action.

If there is any other analytics tracking that you would like to see us work on for Ninja Forms, please let us know in the comments below!