WordPress Forminator form Tracking with Google Tag Manager

Forminator Form Tracking with GTM

Forminator Form is a powerful and popular form builder for WordPress. Today, I will share a step-by-step guide to tracking Forminator with Google Tag Manager. In this comprehensive tutorial, I will detail how to track Forminator forms so that you can monitor them with GA4. Additionally, I will provide code that captures user-inputted values, such as email addresses, phone numbers, names, etc., to enhance conversion tracking.

Forminator Form Tracking Code

<script>
/**
* Author: Md Hasanuzzamna
* Linkedin: https://linkedin.com/in/md-h
* Youtube: https://youtube.com/@leomeasure
* Email: info@leomeasure.com
*/

(function() {
    function formDataToObject(formData) {
      var object = {};
      formData.forEach(function(value, key) {
        object[key] = value;
      });
      return object;
    }

    jQuery(document).on('forminator:form:submit:success', function (e, formData) { 
        var formDataObject = formDataToObject(formData);

        window.dataLayer = window.dataLayer || [];
        dataLayer.push({
            event: 'forminator_form_submit',
            form_id: formDataObject.form_id,
            inputs: formDataObject
        });
    });
})();
</script>

Leave a Comment

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

Get A Quote

Please contact us for expert guidance & personalized solutions to maximizing the potential of Google Analytics for your business.

Send Us A Message

    Contact Us

    Please contact us for expert guidance & personalized solutions to maximizing the potential of Google Analytics for your business.

    Send Us A Message