Google Analytics 4

For this form action to work, you must have an existing connection to Google Analytics 4 (GA4) configured for your site. Site Kit by Google is recommended. This action supports connections either directly to GA4 or through Google Tag Manager. If you do not have an existing connection, this form action will do nothing. 

Each time a form is submitted, an event can be created in Google Analytics 4 using this form action.

Adding a new Google Analytics 4 action

In the Emails & Action tab of the form builder, select Add New Action. From the Actions window that slides out to the right, click Google Analytics 4. The action will be added to your form, appearing in the list to the left.

image of the emails and actions tab with Add New Action and Google Analytics 4 highlighted.

Configuring the Google Analytics 4 action

image of the google analytics 4 form action settings window with three settings highlighted: 1 - action name 2 - ga4, gtm toggle 3 - event name

1. Action Name

Change the name of the action as it appears under Emails & Actions. This name has no relationship to the analytics Event the action creates.

2. GA4 / GTM Toggle

If you are using a direct connection to GA4, choose the GA4 option and move on to setting your Event Name.

If you are connecting through Google Tag Manager, choose the GTM option and see the GTM Tag Setup step below.

If you’re not sure, please ask your website administrator for clarification.

GTM Tag Setup (GTM users only)

If and only if you are a GTM user, you will also need a Tag setup in your GTM container to the following specifications. Don’t forget to save and publish the changes to your container after you’re done.

Tag Configuration

Tag Type: Google Analytics: GA4 Event

Measurement ID: enter your GA4 Measurement ID here

Event Name: you have two options here:

  1. {{Custom Event Name}} variable: this will use the Event Name you set in the form action (step 3 below) as the name the Event appears as in GA4.
  2. Instead of the variable, you may enter custom text here and that text will become the name of the Event as it appears in GA4. This will override the Event Name setting of the form action in step 3 below for this purpose only (it’s still required for the Trigger).

Triggering

Trigger Type: Custom Event

Event Name: This needs to be an exact match of the Event Name you enter into the form action (step 3 below).

This Trigger Fires on: Some Custom Events

Fire this trigger when:

  • Custom Even Name
  • Equals
  • exact match of the Event Name you enter into the form action (step 3 below)

3. Event Name

If you are using a direct connection to GA4, the name you enter here will be the name of the Event as it appears in GA4.

If you are connecting through Google Tag Manager, an exact match of the name you enter here must be used in the Event Name setting of your Trigger and, at your discretion, the Event Name setting of your Tag; see GTM Tag Setup (GTM users only) above for reference.

How soon will I see Events appear in GA4?

Your Event should be logged under Reports > Realtime overview fairly soon after form submission. Events will disappear from Realtime about 30 minutes after being logged.

For Events to populate anywhere outside of Realtime (e.g. Reports > Engagement > Events or in Explorations), there will be a delay of anywhere from several hours (typical) up to 48 hours. This is due to how GA4 reporting works and isn’t something that can be adjusted in Ninja Forms. If you don’t see your test events populating right away except for in Realtime, that’s normal.