I need to be able to track form submissions from my contact page. There’s no URL redirect option for a “Thank You” page – which is fine, but I’m instead going to have to use event tracking in Google Analytics to see that these submissions are properly accounted for.
Can you please tell me where I need to go in the Choices theme to add the code (below). I know where it would go in the HTML itself, but unsure where to go to customize it in the theme.
onClick=_gaq.push(['_trackEvent', 'Contact', 'Form Submission', 'Contact Page Form',, false]);
Maybe you can put the code above on js > avia.js, after this code
So, I tried that, and it didn’t work. However I’m pretty sure I found where the code needs to be placed.
framework / php / class-form-generator.php
<p><input type=”submit” value=”‘.$this->form_paramas.’” class=”button” /></p>
If that’s in fact where the tracking needs to go, can you show me how the two need to be put together?
Thanks a bunch.
The onclick attribute is a simple attribute which can be added to the input tag. In wp-contentthemesenfoldframeworkphpclass-form-generator.php replace
$this->output .= '<input type="submit" value="'.$this->form_params['submit'].'" class="button" />';
$this->output .= '<input type="submit" onClick="_gaq.push(['_trackEvent', 'Contact', 'Form Submission', 'Contact Page Form',, false]);" value="'.$this->form_params['submit'].'" class="button" />';
The topic ‘Adding Event Tracking To Choices Contact Form’ is closed to new replies.