• Resolved DickRaney

    (@dickraney)


    I’m using the HTML Forms plugin and want to track form submit events. They provide a javascript snippet to detect a successful submit and I want to know how to customize it to work with Monster Insights?

    Their snippet looks like this:

    <script>
    html_forms.on('success', function(formElement) {
    	// your code goes here
    });
    </script>

    Is this proper way to track the submit?

    <script>
    html_forms.on('success', function(formElement) {
    	__gaTracker.push(['_trackEvent', 'contact-form', 'submit', 'contact']);
    });
    </script>

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter DickRaney

    (@dickraney)

    I can say that my code above is not working, so would appreciate any help.

    Plugin Support Michelle D.

    (@devmich)

    Hi @dickraney,

    I’m so sorry for the wait here.

    I reached out to our developer team and confirmed instead of __gaTracker() you’ll need to switch to using __gtagTracker().

    This also means your parameters need to change to…

    __gtagTracker('event', 'conversion', {
       event_category: 'form',
       event_label: 'contact-form',
       value: 1,
     });

    In case it helps, using __gtagTracker() means you do not need to use .push, which is why it’s been excluded.

    If you have multiple forms you would like to automatically track impressions and conversions for without any coding required, you can take advantage of our Forms Addon. With this, you’ll also be able to view reports right inside of your WordPress dashboard at Insights » Reports » Forms.

    If you’d like to learn more, or if you continue to have some trouble, please reach out to us at https://www.monsterinsights.com/lite-support/, where our team will be happy to continue to assist.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘HTML Forms Event Tracking’ is closed to new replies.