Custom Formidable Form Tracking with GTM

Posted by: Felix Kaboto Date Posted: April 25, 2024
Back to Case Studies

Issue

Thomas J. Henry Law needed accurate tracking of form submissions on their website to better understand user behavior and measure conversion rates. Unfortunately, their current setup did not capture all form submissions due to a lack of integration with Formidable forms. The proposed tracking solution we sent them will allow them to track only successful form submissions.

Solution

Solution Applied:

  • Enabling AJAX Submissions: The first step was to ensure that all Formidable forms on the client’s website were set to submit using AJAX, providing a seamless user experience and compatibility with the custom GTM event listener.

  • Creating the Custom HTML Tag: A custom HTML tag in GTM containing a JavaScript event listener designed to detect the ‘fxFormComplete’ event, which is triggered by Formidable forms upon a successful AJAX submission.

    <script>
    jQuery(document).ready(function($){
    $(document).on( 'frmFormComplete', function( event, form, response ) {
    var formID = $(form).find('input[name="form_id"]').val();
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push({
    'event': 'fxformidable_form_submitted',
    'formID': formID
    });
    });});
    </script>

Achievement

Implemented a custom JavaScript event listener within Google Tag Manager (GTM) to track Formidable form submissions

Snippet/Screenshot/Link

Here is a link to the guru card for this process used here – https://app.getguru.com/card/TxyAgnMc/MA-Tracking-Formidable-Form-with-GTM