ANALYTICS

How to Setup Ninja Forms Event Tracking with Google Tag Manager

Ninja forms are one of the leading & known plugins for WordPress which has a wide user portfolio after Contact Form 7, Gravity Forms, Formidable & other leading best WordPress contact forms plugins.

With the help of Ninja Forms, you can create forms without coding knowledge with their drag & drop functionality. You can add it anywhere on your WordPress blog or website.

This form comes with both Freemium & Premium features.

Where the Freemium plan only offers the form creation & data collection, the premium plan offers a lot more than this.

Some of the premium features are:

  1. Accept Payments using PayPal, Stripe, Elavon etc
  2. Email Marketing Integrations with leading SAAS like MailChimp, AWeber, ConvertKit & ore
  3. Users management & analytics
  4. CRM Integrations like Salesforce, Zoho CRM, Zapier & more
  5. Notifications & Workflow Upgrades with ClickSend, Twilio, Zapier etc.
ninja forms wordpress

Apart from this, the crucial step to track the form which you add on various pages to collect leads, information, contacts. Survey etc.

This is always important to track your forms so that you can measure the performance how your forms are doing or are they worth to add on website etc.

In this blog, we will learn how we can easily set up Ninja Forms conversion tracking using Google Tag Manager & Google Analytics.

To do this, we need to create some tags, triggers and variables. Follow the steps as mentioned below:

Step 1: Create a tag to listen the actually submitted forms.

This tag is a Javascript code which helps to listen to the variable which generated when your form gets actually submitted.

To create this, go to Tags > New > select Custom HTML from the tag types & paste the JavaScript from below:

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

I’ve named mine “Ninja Form Submission”, you can name is as per your convenience.

Step 2: Create a data layer variable which added to datalayer to pass values

To create the Ninja Form data layer go to Variables > New > Variable Type (Data Layer Variable) > Name it NFformID (or any name you want to have) & save it.

Step 3: Create a trigger to fire on each form submission

This is very important to create a trigger carefully as this will be fired whenever your form gets submitted.

To create, go to Trigger > New>

Trigger Type: Click – All Elements

Event Name: Contact Us Form Submission or any other you want

This Trigger Fires On: Some Clicks > NFFormID (The variable we created earlier) > Contains > the value of the variable in debug mode

ninja forms wordpress plugin

Step 4: Create the tag for form submissions

Now, we need to create another tag which will as follows:

Go to Tags > New

Tag Type (Universal Analytics)

Track Type: Event

Category: Event or anything you want

Label: Form Submit or anything you want

Non-Interaction Hit: False

Google Analytics Setting: Choose from existing or override to add new

ninja forms conversion tracking

Once you create this tag, fire this to the trigger we have created on Step #3.

Step 5: Setting up the Goal Conversion in Google Analytics

Once you done the tag creation, you need to create the goal in Google Analytics.

To create this, you need to login to Google analytics & follow the steps below:

  1. Google Analytics > Admin > Goals > +New
  2. Goal setup– Custom
  3. Goal description – Contact Us Form Submission or whichever you want
  4. Goal Type – Event
  5. Goal details – Fill the Category, Action, Label as per your requirement
ninja forms analytics

Once you are done with this setup, save this goal.

Always remember to do lots of tests before you move this to live.

If you think we have missed any important information in this blog, let us know if in the comment.

If you are using Contact Form 7, check the Contact Form 7 event setup guide.

If you need any assistance on your SEO campaign, you can hire us by getting a 14 Days Free SEO Trial.

Need any help or assistance in Google Analytics?

Ninja Form Event Tracking FAQs

What is Ninja Forms in WordPress?

Ninja Form is a plugin for creating various kind of forms in WordPress. This plugin is completely user friendly & webmasters can create them by using various options & simple drag and drop functionality.

How to Track Ninja forms in WordPress?

Ninja Forms submissions can be tracked easily using Google Tag Manager & Google Analytics. Just follow the steps mentioned in this blog.

How to create a Ninja Form in WordPress?

Creating Ninja Forms in WordPress is easy. You need to simply install the plugin & choose the style, options you need to add to your form.

What is event tracking in Ninja forms?

Ninja Form event tracking setup means tracking the successful form submission activities. This can be done using Google Tag Manager & Google Analytics. Read this blog for more.

Related Articles

How to Setup Google Ads Conversion Tracking in BigCommerce (With Order Amount & Order ID)

How to Setup Enhanced Ecommerce Tracking to WooCommerce

The Use of Artificial Intelligence (AI) in SEO – All You Need To Know

How to Setup Contact Form 7 Event Tracking with Google Tag Manager

Best Website Traffic Monitoring Tools

How To Create Custom Reports In Google Analytics

COVID-19 Updates: Google Announces $800+ million to support small businesses and crisis response

Previous article

How to Setup Enhanced Ecommerce Tracking to WooCommerce

Next article
Sumit Kumar
Sumit is a digital marketing specialist and results-driven entrepreneur with more than ten years of rich industry experience. His engaging and insightful columns help audience to make it big.

You may also like

12

Comments
  1. Fine way of describing, helped me to setup form tracking for my website.

    1. Thanks Rhona.

  2. How do I find the value of the variable in debug mode as you outline in step 3?

    1. Just submit the form in debug mode once you create the variable. Check for the list of variables.

      1. Thank you for a well-made explanation , if in the debug mode the variable NFformID appears as undefined, that’s the value for the trigger configuration?

        1. To answer this, I would like to tell you that in this case, we need to look out for any other variable or unique create a custom variable for that form so that we get the right tracking. We also need to be sure that the tracking is only done on actual form submissions, not for all the valid or invalid form submission. This would be a bit tricky task but I am sure you will do this.

  3. Is there a way to track multi-step forms. In these instructions the tag fires upon submission. If we’re trying to gather data on which step in the multi-step form the user falls out on then it would be helpful to track the “Next” buttons. Although if there are multiple “Next” buttons then it may be difficult to get figure out which “Next” button was clicked.

    1. Hi C,

      To answer this, I would like to tell you that in this case, we need to create multiple buttons tracking. This is called step tracking where we track buttons on each step. Just we need to add different click IDs or custom variable to each “Next” button.

      Let me know if you have any further query.

      Thanks

      1. Could you explain how this would be done? I can’t seem to get the variable data when clicking the next buttons as they take me to a new page. Contol/Command clicking doesn’t seem to work either.

        1. Sure, email me at Sumit@searchenginemonkey.com. I’d love to help.

  4. What should the trigger be for Step #1? I don’t see this anywhere.

    1. Hi Mojo,

      The trigger you need to create is mentioned in Step #3.

      Please write to me if you are facing any trouble in setting this up at admin@searchenginemonkey.com. I’d love to help.

      Thanks

Leave a reply

Your email address will not be published. Required fields are marked *