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

    Hi Guys,

    I was wondering how to set the contact form button on my site to open a new ‘thank-you’ page to help me track journeys better in analytics?




    After the visitor clicks the submit button, you will notice that the form disappears and a thank you page in essence is displayed. You can customize that portion to record an event in analytics. You can also record the event when the button is clicked. You can add something like this to any link or button on your site to track when someone clicks them

    <a href="" onclick="javascript: pageTracker._trackPageview('/important-event/submit-button-clicked');">click me</a>




    Thanks Nick, where do I add that code?



    You can use the contact form builder option:

    Best regards,




    Please open /framework/php/class-form-generator.php and find like 165 that looks like

    $this->output .= '<input type="submit" value="'.$this->form_params['submit'].'" class="button" />';

    and change it to look like

    $this->output .= "<input type="submit" onClick="_gaq.push(['_trackEvent', 'form' , 'submit', 'email subscription', 10]);" value='".$this->form_params['submit']."' class="button" />";

    If you are new to Analytics and not sure what you are doing it is best to leave this alone.

    But there are useful free tools such as this

    or form tracking code like this

    But such advanced Analytics integration and the installation of these scripts would be outside the scope of the support form i think.



Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Submit form to open a new page’ is closed to new replies.