If you have troubles since the update to WordPress 4.5 please read this post before opening a new thread.
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.
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.