Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #23853

    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();”

    Thanks.

    #121374

    Hi,

    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

    jQuery.noConflict();
    jQuery(document).ready(function(){

    Regards,

    Ismael

    #121375

    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.

    #121376

    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" />';

    with

    $this->output .= '<input type="submit" onClick="_gaq.push(['_trackEvent', 'Contact', 'Form Submission', 'Contact Page Form',, false]);" value="'.$this->form_params['submit'].'" class="button" />';

    #121377

    Great! GA is now tracking the submissions. It looks like this has changed the button text, but I think I can take care of that.

    Thanks guys.

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Adding Event Tracking To Choices Contact Form’ is closed to new replies.