Can you add on-click tracking to a form button?

  • Profile Image
    Asked on July 30, 2014 at 05:42 PM

    I wanted to know if there was a way to set up on-click tracking on the button of a form without having to embed the form on the page. We are using an iFrame right now and I don't have any click tracking. The only other option I thought about was to create a custom thank you page in order to track this. Any help or direction you could provide would be greatly appreciated.

    The site this form is on is not live yet so I am just linking to the form. What I would love to do is set up conditional, if someone contacts support add one tracking code, and someone clicks generic add a different code, etc. I don't think this is possible but I thought I would double check to see if I am missing something.


  • Profile Image
    Answered on July 30, 2014 at 07:24 PM

    1) As far as I know, you actually need to download  the form  Source Code.

     2) Find the submit button syntax. e.g.

    <button id="input_2" type="submit" class="form-submit-button">Submit</button>

    3) Edit the submit button and add the tracking code. e.g.

    <button id="input_2" type="submit" class="form-submit-button" onclick="_gaq.push(['_trackEvent', 'resources', 'Email', 'full measure and install guide', 1, true]" )>Submit</button>

    4) Replace the current embed code in your website with form Source code.