Title: Event Listener code
Last modified: February 11, 2019

---

# Event Listener code

 *  [majority](https://wordpress.org/support/users/majority/)
 * (@majority)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/event-listener-code/)
 * I want to track conversion when a form (created with WPforms) is sent.
 * If I was using Contact 7 forms the code would be:
    <script> document.addEventListener(‘
   wpcf7mailsent’, function( event ) { gtag(‘event’, ‘conversion’, {‘send_to’: ‘
   TRACKING-CODE-HERE’}); }, false ); </script>
 * BUT, for design reasons, I want to use WPforms.
 * Can support please advise what should I use to replace ‘wpcf7mailsent’ ?
 * Thanks heaps
    Mike

Viewing 1 replies (of 1 total)

 *  Plugin Support [Ethan Choi](https://wordpress.org/support/users/ethanchoi/)
 * (@ethanchoi)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/event-listener-code/#post-11203287)
 * Hi majority,
 * I apologize as we’re not able to provide support for the custom coding required
   for Google Analytics.
 * Instead, we recommend using our sister product [MonsterInsights](https://www.monsterinsights.com/)
   with its form addon. This addon would require the Pro version of MonsterInsights.
   In case it helps, we have a [walkthrough for this approach](https://wpforms.com/how-to-use-google-analytics-to-track-form-submissions-in-wordpress/).
 * It’s possible to use custom code, as well, and typically this would involve adding
   tracking code to a confirmation message/page — however this is not something 
   we’re able to provide support for at this time.
 * If you’ve any other questions, please feel free to reach out.
 * Thanks 🙂

Viewing 1 replies (of 1 total)

The topic ‘Event Listener code’ is closed to new replies.

 * ![](https://ps.w.org/wpforms-lite/assets/icon.svg?rev=3254748)
 * [WPForms - Easy Form Builder for WordPress - Contact Forms, Payment Forms, Surveys, & More](https://wordpress.org/plugins/wpforms-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpforms-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpforms-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/wpforms-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpforms-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpforms-lite/reviews/)

## Tags

 * [conversion](https://wordpress.org/support/topic-tag/conversion/)
 * [dom](https://wordpress.org/support/topic-tag/dom/)
 * [EventListener](https://wordpress.org/support/topic-tag/eventlistener/)

 * 1 reply
 * 2 participants
 * Last reply from: [Ethan Choi](https://wordpress.org/support/users/ethanchoi/)
 * Last activity: [7 years, 3 months ago](https://wordpress.org/support/topic/event-listener-code/#post-11203287)
 * Status: not a support question