Title: Add Google Analytics event tracking code to submit button
Last modified: September 19, 2019

---

# Add Google Analytics event tracking code to submit button

 *  Resolved [alextester](https://wordpress.org/support/users/alextester/)
 * (@alextester)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/add-google-analytics-event-tracking-code-to-submit-button/)
 * Hi, how can I add this code to my submit button so that Google Analytics can 
   track contact form submissions please?
 * onClick=”ga(‘send’, ‘event’, { eventCategory: ‘Contact Form’, eventAction: ‘Send
   Message’, eventLabel: ‘Contact Form’, eventValue: 0});”

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

 *  Plugin Support [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * (@wpmudev-support2)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/add-google-analytics-event-tracking-code-to-submit-button/#post-11950701)
 * Hello [@alextester](https://wordpress.org/support/users/alextester/) ,
 * I have checked and our developers recommended using this code for tracking submits
   in GA:
 *     ```
       <script>
       jQuery('form#forminator-module-21').on('forminator:form:submit:success', function (e) { 
          ga('send', 'event', 'Form Title', 'submit');
        });
       </script>
       ```
   
 * You will need to change form#forminator-module-21 to ID of your form.
 * kind regards,
    Kasia
 *  Thread Starter [alextester](https://wordpress.org/support/users/alextester/)
 * (@alextester)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/add-google-analytics-event-tracking-code-to-submit-button/#post-11953638)
 * Thank you Kasia!
 * Alex
 *  Thread Starter [alextester](https://wordpress.org/support/users/alextester/)
 * (@alextester)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/add-google-analytics-event-tracking-code-to-submit-button/#post-11955494)
 * Hi Kasia,
 * Unfortunately, this code hasn’t worked – I did double-check the ID was correct.
   I added the code to the footer.
 * Alex
 *  Plugin Support [Imran – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support9/)
 * (@wpmudev-support9)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/add-google-analytics-event-tracking-code-to-submit-button/#post-11955922)
 * Hello [@alextester](https://wordpress.org/support/users/alextester/) ,
 * Hope you’re doing well!
 * Please try adding the code into the header. Google Tag Manager code needs to 
   be located between the `<hear> ..</head>` section.
 * Let us know how it went!
 * Kind regards,
    Nastia
 *  Thread Starter [alextester](https://wordpress.org/support/users/alextester/)
 * (@alextester)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/add-google-analytics-event-tracking-code-to-submit-button/#post-11957829)
 * Hi Nastia,
 * Thanks for you’re continuing help. I’ve moved the script to the <head> but submitting
   the form still won’t trigger an event unfortunately!
 * view-source:[https://wollastonconstruction.co.uk/](https://wollastonconstruction.co.uk/)
 * Any more ideas?
 * Best,
 * Alex
 *  Plugin Support [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * (@wpmudev-support2)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/add-google-analytics-event-tracking-code-to-submit-button/#post-11957950)
 * Hello [@alextester](https://wordpress.org/support/users/alextester/) ,
 * Let me consult this with developers and they will see what could be the problem.
 * We will keep you updated.
 * kind regards,
    Kasia
 *  Plugin Support [Dimitris – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support6/)
 * (@wpmudev-support6)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/add-google-analytics-event-tracking-code-to-submit-button/#post-12023892)
 * Hello [@alextester](https://wordpress.org/support/users/alextester/)
 * Could you please send me an email to [contact@wpmudev.org](https://wordpress.org/support/topic/add-google-analytics-event-tracking-code-to-submit-button/contact@wpmudev.org?output_format=md)
   using this template:
 * > Subject: “**Attn: Dimitris**”
   >  Message: link back to this thread for reference
 * Keep in mind the subject line as ensures that it gets assigned to me.
 * Thank you,
    Dimitris
 *  Thread Starter [alextester](https://wordpress.org/support/users/alextester/)
 * (@alextester)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/add-google-analytics-event-tracking-code-to-submit-button/#post-12025573)
 * Hi Dimitris, I have done so. Thank you for looking into this.
 * Alex
 *  Plugin Support [Imran – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support9/)
 * (@wpmudev-support9)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/add-google-analytics-event-tracking-code-to-submit-button/#post-12094031)
 * Hello [@alextester](https://wordpress.org/support/users/alextester/) ,
 * I trust you’re doing well!
 * We’ve not heard from you in a while. I’ve marked this ticket as resolved for 
   now, but if you need anything else at all, we’re here for you, please just reopen
   the ticket or create a new one.
 * Have a good day and take care!
 * Kind regards,
    Nastia

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

The topic ‘Add Google Analytics event tracking code to submit button’ is closed 
to new replies.

 * ![](https://ps.w.org/forminator/assets/icon-256x256.gif?rev=3443182)
 * [Forminator Forms – Contact Form, Payment Form & Custom Form Builder](https://wordpress.org/plugins/forminator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/forminator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/forminator/)
 * [Active Topics](https://wordpress.org/support/plugin/forminator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/forminator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/forminator/reviews/)

## Tags

 * [forms](https://wordpress.org/support/topic-tag/forms/)
 * [tracking](https://wordpress.org/support/topic-tag/tracking/)

 * 9 replies
 * 4 participants
 * Last reply from: [Imran – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support9/)
 * Last activity: [6 years, 7 months ago](https://wordpress.org/support/topic/add-google-analytics-event-tracking-code-to-submit-button/#post-12094031)
 * Status: resolved