How to Track Ninja Forms Submissions in Google Analytics 4 Using Google Tag Manager

Ninja Forms Submission Tracking

If you use Ninja Forms on your website, tracking form submissions is one of the most important things you can set up in Google Analytics 4. It tells you how many leads and enquiries your site is generating, which pages are driving them, and where your traffic is coming from.

The problem is that Ninja Forms does not work the same way as other form plugins when it comes to tracking. This guide walks you through the exact process I use to get it set up correctly inside Google Tag Manager.

Before You Start

This guide assumes you already have Google Tag Manager and GA4 installed and firing correctly on your website. If you have not done that yet, check out my earlier video on how to get both platforms connected before coming back to this one.

Why Ninja Forms Needs a Different Setup

With some form plugins, Google Tag Manager can detect a form submission automatically using a built-in trigger. Ninja Forms does not work that way.

By default, Ninja Forms does not push submission data into the Data Layer. The Data Layer is essentially a behind-the-scenes communication channel that sits on your website and passes information across to Google Tag Manager. Because Ninja Forms skips this step on its own, GTM has no way of knowing a form was submitted unless you manually set it up to do so.

The fix is a small custom JavaScript tag called a listener. You add it inside GTM and it watches for Ninja Forms submission events on the page. When it detects one, it pushes that information into the Data Layer so GTM can pick it up and act on it.

It is less complicated than it sounds. Follow the steps below and you should have everything working within about 15 minutes.

Step 1: Create the Ninja Forms Listener Tag in GTM

Head into your Google Tag Manager account and create a new tag. Name it Ninja Forms Listener so it is easy to identify later.

For the tag type, select Custom HTML.

Paste the following code into the Custom HTML field:

<script>
jQuery(document).ready( function() {
  jQuery(document).on('nfFormSubmitResponse', function(event, response, id) {  
      dataLayer.push ({
        'event' : 'ninjaFormSubmission',
        'NFformID' : response.id  
            });
         });
    });
</script>

For the trigger, set this tag to fire on All Pages. The listener needs to be active across your whole website, not just the page where your form lives. If someone lands on a different URL that has the same form, you do not want those submissions slipping through untracked.

Save the tag once that is done.

Step 2: Test the Listener Tag

Before moving on, you want to confirm the listener is actually doing its job.

Click Preview in the top right corner of Google Tag Manager. Enter the URL of the page where your Ninja Form lives and click Connect. This opens your website in a new tab with Tag Assistant running in the background.

Start by trying to submit the form without filling in any of the required fields. You want to make sure an incomplete submission does not fire an event, because if it does, your conversion numbers will be off.

Now fill the form out with some dummy details and hit submit.

Head back to Tag Assistant and look for an event called ninjaFormSubmission in the left panel. Click on it and then click the Variables tab. You should see the event name sitting in there. Take note of it, including the capitalisation, because you will need to match it exactly in the next step.

If it is showing up, the listener is working and data is being pushed into the Data Layer correctly.

Step 3: Create a Custom Event Trigger

Now you need a trigger that fires whenever the ninjaFormSubmission event shows up in the Data Layer.

Go to Triggers in GTM and click New. Click Trigger Configuration and choose Custom Event from the list.

In the Event Name field, type ninjaFormSubmission exactly as it appeared in Tag Assistant. This field is case sensitive, so it has to match perfectly.

If you are tracking a single form, or you just want all forms treated the same way, leave it set to All Custom Events. If you have multiple forms across your site and want to track them individually, you can filter by the NFformID value to separate them.

Name the trigger Ninja Form Submission and save it.

Step 4: Create the GA4 Event Tag

Now you need the tag that actually sends submission data through to Google Analytics 4.

Go to Tags and click New. Click Tag Configuration and select Google Analytics: GA4 Event from the list.

For the Measurement ID, head into your GA4 account and grab it from Admin > Data Streams. It starts with a G followed by a dash and a string of characters. Paste that into the Measurement ID field.

For the Event Name, use something clear like ninja_form_submission. Keep it lowercase with underscores to stay consistent with how GA4 handles event names.

Scroll down to the Triggering section and select the Ninja Form Submission trigger you just created.

Name the tag GA4 – Ninja Form Submission and save it.

Step 5: Test the Full Setup End to End

Head back into GTM and click Preview again. Connect to your website, fill out the Ninja Form with dummy information and submit it.

Go back to Tag Assistant and click on the ninjaFormSubmission event. This time you should see both the Ninja Forms Listener tag and the GA4 Ninja Form Submission tag listed as fired. If both are showing as fired, things are looking good.

Now head into Google Analytics 4 and go to Admin > Data Display > Debug View. You should see the ninja_form_submission event appear in the event stream. If it does not show straight away, give it a minute or two as there can be a slight delay before it comes through.

Step 6: Mark the Event as a Key Event in GA4

Once you have confirmed the event is firing correctly, you want GA4 to treat it as a conversion so it actually shows up in your reporting.

Go to Admin > Data Display > Events inside GA4. Keep in mind the ninja_form_submission event can take up to 24 hours to appear in this list after your first test, so check back the following day if it is not there yet.

Once it appears, click the toggle next to the event to mark it as a Key Event. This tells GA4 the action is significant, and it will now be reported on as a conversion across your account.

If you are running Google Ads, you can also import this Key Event directly into your Google Ads account as a conversion action. That means you will be able to see which campaigns and keywords are actually driving form submissions on your site, which makes a real difference when you are trying to get the most out of your ad spend.

Wrapping Up

That is the full setup. Once everything is in place, every Ninja Forms submission on your website will be tracked through to GA4, giving you a much clearer picture of how your site is performing and where your leads are coming from.

If you want to follow along visually, the video at the top of this page walks through every step. Make sure you subscribe to the channel for more tutorials like this one.