Google Analytics

You can use the quform:successStart JavaScript hook to send an event to Google Analytics when the form is submitted.

Check the Google Analytics code you added to your site to see if you are using the newer gtag.js integration or the older analytics.js one. Then go to Forms → Settings → Custom CSS & JS and at the Custom JavaScript field enter the code below.

Site is using gtag.js

1
23
4
5
jQuery(function ($) {
    $('.quform-form-1').on('quform:successStart', function () {        gtag('event', 'submit', { 'event_category': 'Contact Form' });
    });
});
jQuery(function ($) {
    $('.quform-form-1').on('quform:successStart', function () {
        gtag('event', 'submit', { 'event_category': 'Contact Form' });
    });
});
  • On line 2, replace the number 1 with the form ID
1
2
3
4
5
jQuery(function ($) {
    $('.quform-form').on('quform:successStart', function () {
        gtag('event', 'submit', { 'event_category': 'Contact Form' });
    });
});
jQuery(function ($) {
    $('.quform-form').on('quform:successStart', function () {
        gtag('event', 'submit', { 'event_category': 'Contact Form' });
    });
});

Site is using analytics.js

1
23
4
5
jQuery(function ($) {
    $('.quform-form-1').on('quform:successStart', function () {        ga('send', 'event', 'Contact Form', 'submit');
    });
});
jQuery(function ($) {
    $('.quform-form-1').on('quform:successStart', function () {
        ga('send', 'event', 'Contact Form', 'submit');
    });
});
  • On line 2, replace the number 1 with the form ID
1
2
3
4
5
jQuery(function ($) {
    $('.quform-form').on('quform:successStart', function () {
        ga('send', 'event', 'Contact Form', 'submit');
    });
});
jQuery(function ($) {
    $('.quform-form').on('quform:successStart', function () {
        ga('send', 'event', 'Contact Form', 'submit');
    });
});

Site is using Google Tag Manager

1
23
4
5
jQuery(function ($) {
    $('.quform-form-1').on('quform:successStart', function () {        dataLayer.push({'event': 'Contact Form'});
    });
});
jQuery(function ($) {
    $('.quform-form-1').on('quform:successStart', function () {
        dataLayer.push({'event': 'Contact Form'});
    });
});
  • On line 2, replace the number 1 with the form ID
1
2
3
4
5
jQuery(function ($) {
    $('.quform-form').on('quform:successStart', function () {
        dataLayer.push({'event': 'Contact Form'});
    });
});
jQuery(function ($) {
    $('.quform-form').on('quform:successStart', function () {
        dataLayer.push({'event': 'Contact Form'});
    });
});

Still having trouble? Head over to the forums.

Forums