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

    I was trying to add the suggested code to the form button,

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

    as suggested here:

    And got the following error:
    Parse error: syntax error, unexpected ‘_trackEvent’ (T_STRING) in /home/maasen/public_html/wp-content/themes/enfold/framework/php/class-form-generator.php on line 179


    Hi paulsutton!

    It’s a quote issue, try with this code instead:

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



    thank you, it didn’t error out, so I can assume it works.



    It should, perform some tests and let us know if it presents any issues :)



    thanks, will do.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Syntax Error when adding tracking code to form submit button’ is closed to new replies.