Formidable Forms

Formidable Forms

  • Features
  • Pricing
  • Resources
    • Docs & Support
    • Blog
    • Community
  • Solutions
    • Web Applications
    • Calculators
    • Surveys
    • Directories
    • Payments
    • Contact forms
  • Login
  • Get Formidable Forms

How can I set up Google Analytics with my forms?

Last Updated: April 28, 2020

Knowledge Base → Installation & Getting Started → Frequently Asked Questions → How can I set up Google Analytics with my forms?

Introduction

Google Analytics is a developer tool created by Google that allows you to learn about and manage the way people experience your site.  You can implement Google Analytics on any website to see how users browse your site, from what pages they arrive at your forms, how many times your forms are submitted, and so much more! In this article, you will learn how to set up Google Analytics, and further more, how to track form submissions.

Formidable Forms is the best WordPress Form Builder plugin. Get it for free!

Setting Up Google Analytics

If you are a new user to Google Analytics, you will want to make sure you follow these directions to create an account and set up your tracking code correctly. If you are already a Google Analytics user, you will want to make sure your tracking code is set up correctly on your site.

What's a tracking code?

A tracking code is a block of javascript that is put on each page of your website that you want Google Analytics to track, thereby gathering statistics of what pages people frequent most, what types of devices they are using, etc.  It will usually look something like the code below.

<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-XXXX-Y', 'auto');  // Replace with your property ID.
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->

Universal Analytics

What is Universal Analytics you might ask? Universal analytics is the new standard for Google Analytics. Just a little while ago, Google Analytics used what is now called Classic Google Analytics. Just recently, Universal Analytics has become the new standard, as it allows real-time statistics and more functionality, among other added benefits. So why is this important? Classic Google Analytics and Universal Analytics use slightly different code. Currently, it is best practice to use Universal Analytics. If you are unsure of which version you are using, you can refer to this article to help you. If you find that you are using Classic Google Analytics, you can follow the directions in the Upgrade Center to upgrade to Universal Analytics. Please note, all of our code examples for Google Analytics use the coding standards for Universal Analytics.

Using event tracking

You can use Google Analytics to track individual events that users make on your site, such as form submissions. The custom code example can be used as such to track form submissions on a form-by-form basis. You can then track the events under the Behavior > Events tab. In order to use event tracking with Formidable, you must submit the form with AJAX.

Note: Events won't be tracked if you have the 'Redirect to URL' setting enabled on submit.

Setting Up Event Tracking

The custom code example can be used as such to track form submissions on a form-by-form basis. This script should be placed either after your form shortcode on a page, or in the form's "On Submit" message in your Form Settings.

<script>
jQuery(document).ready(function($){
  $(document).on( 'frmFormComplete', function( event, form, response ) {
    var formID = $(form).find('input[name="form_id"]').val();
    if ( formID == 5 ) { // change 5 to your form id
      ga('send', 'event', 'form name', 'sent'); // change 'form name' to the category set in Google
    }
  });
});
</script>

Viewing Your Events

Once a user submits a form that you are implementing event tracking on, you can view the events by going to the Google Analytics Dashboard, clicking Behavior > Events > Overview on the left menu. This will show you an overview of your events based on category, action and label.

Using Auto-Event Tracking with Google Tag Manager

With Google Analytics, it is possible to track events with Google Tag Manager. A brief description of auto-event tracking from a Google support article states the following:

With Auto-Event Tracking in Google Tag Manager, capturing these actions is easy. Rather than hardcoding each click action with Javascript (such as ga('send', 'event', 'category', 'action', 'label') in analytics.js), you can create event tags directly within the Google Tag Manager interface and fire them with triggers based on predefined variables or on custom variables that you can build within the Google Tag Manager UI.

Please note, if your form submits with AJAX, it will prevent event tracking with Google Tag Manager from working properly.

You can also find a tutorial from a user about how to track leads with Google Tag Manager form submit tracking.

Using Google Analytics with MonsterInsights

If manually adding the tracking code to your site seems like a daunting task, you can now easily manage the Google Analytics tracking services with MonsterInsights. This plugin simplifies the whole process with an integration that includes features like:

  • Tracking all forms created on your site
  • Enabling event tracking for form submissions
  • Tracking form views and conversions
  • Easily view reports within the WordPress dashboard
  • Comprehensive conversion rates report

Start tracking the traffic immediately on your Formidable Form the easy way with MonsterInsights.

  • Introduction
  • Setting Up Google Analytics
    • What's a tracking code?
    • Universal Analytics
  • Using event tracking
    • Setting Up Event Tracking
    • Viewing Your Events
  • Using Auto-Event Tracking with Google Tag Manager
  • Using Google Analytics with MonsterInsights
Categories
×

Categories

  • Installation & Getting Started
  • Account Management
  • Forms
  • Entries
  • Views
  • Styles
  • Importing & Exporting
  • Add-Ons
  • Extend Formidable Forms

Using WordPress and want to get Formidable Forms for free?

Get Formidable Forms Lite Now

You do not have permission to view this form. Maybe you need to log in?

This article may contain affiliate links. Once in a while, we earn commissions from those links. But we only recommend products we like, with or without commissions.

Take on bigger projects Right Now

Get the tools you need to revolutionize your workflow and architect a masterpiece. Build the most advanced WordPress forms and actually use the data you collect in meaningful ways.

Get the most advanced WordPress form plugin and the only form builder with integrated Views.

Get Formidable Forms Now

Resources

  • Community
  • Affiliates
  • Contact
  • Free Online Form Builder

Top Features

  • Application Builder
  • Calculator Forms
  • Surveys & Polls
  • Quiz Maker
  • Form Templates
  • Application Templates
  • Directories
  • Donation Plugin

Company

  • About Us
  • Giving Back
  • Careers
  • Newsletter
  • WP Tasty
  • Nutrifox

Copyright © 2023 Strategy11, LLC. Formidable Forms® is a registered trademark Strategy11, LLC.
Privacy Policy | Terms of Service | Sitemap

Join 300,000+ using Formidable Forms to create form-focused solutions fast. Get Started See User Reviews