-
ChristianAsked on August 26, 2019 at 10:28 AM
Hi Jotform,
Is it possible to add an event listener to JotForms?
I ask because we use event as a means of tracking forms in analytics. Normally we use "Contact Form 7" on our WordPress sites but in this scenario we are having complications. How we implement the event listener in "Contact Form 7" is as follows:
<script>
document.addEventListener( 'wpcf7mailsent', function( event ) {
ga( 'send', 'event', 'Contact Form', 'submit' );
}, false );
</script>
Is there some thing similar that I can do with Jotform in order to track submitted forms?
Reference:
https://contactform7.com/tracking-form-submissions-with-google-analytics/
Best Regards,
Christian
-
roneetReplied on August 26, 2019 at 11:55 AM
Unfortunately, we cannot add the Javascript code inside the Form.
What you can do is direct the Form submissions to your custom page and then on that page, you can add the Javascript code there.
Guide: https://www.jotform.com/help/213-Send-Submission-Data-via-Post-Method-and-Thank-You-Settings
Guide: https://www.jotform.com/help/51-How-to-Post-Submission-Data-to-Thank-You-Page
You can also use the Google Analytics Widget http://widgets.jotform.com/widget/google_analytics to track the activities and behaviors of visitors on your form.
Alternatively, you may always use our built-in Analytics Feature https://www.jotform.com/form-analytics/
Let us know if you have further questions.
Thanks.