What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.

  • Profile Image

    Track iFrame Form Submissions as Events in Google Analytics

    Asked by NGHS on November 30, 2015 at 09:13 AM

    What is the best way to track iframe form submissions as events in Google Analytics? The one plugin I tried did not work at all. I'd love to know if there is a better way for iframes. Thank you!

  • Profile Image

    Answered by KadeJM on November 30, 2015 at 12:12 PM

    To my understanding you want to use Google Analytics to track your Embedded iFrame Form Submissions as Events.

    What sort of Events did you want to track?

    Have you tried our Google Analytics Widget? Or is that the one you tried already that didn't work?

    That is currently the only GA Tool we offer though depending on what Events you want to track you could try adding it to the forms full source code as a workaround.

    Alternatively, we have these http://widgets.jotform.com/search/tracking.

  • Profile Image

    Answered by NGHS on November 30, 2015 at 12:16 PM

    That is the widget I tried and it did not work for me. The beauty of the iframe is I can update the form as needed in the online form editor without having to update the implementation itself in the site code. Who wants to mess with ugly source code every time a change is made to the form?

    This is what I want to push to GA when the form is completed without errors:
     ga('send', 'event', 'Category Here', 'OnMouseDown', 'Form Submit - Identifier here');

  • Profile Image

    Answered by KadeJM on November 30, 2015 at 01:48 PM

    As far as I know it should work for some information you wish to track.

    However, since it appears you are attempting to use this for tracking onClick, onMouse, onSubmit those are all javascript related functions which are not allowed to be used within the form as they interfere with the form's functionality causing it to break.

    It is also why there are no additional controls for this within the widget and that is probably why you are getting those errors if otherwise.

    The only way around it is in by adding it to the source code as I mentioned.

  • Profile Image

    Answered by NGHS on November 30, 2015 at 04:22 PM

    Good news! I was able to accomplish event tracking with GA through the JotForm iframe. In order to do this, I used the script embed option, which then creates the iframe on page load. Take a look at a demonstration of my custom script in action: http://goo.gl/B9Ua5m

    This is how the event looks in GA:

  • Profile Image

    Answered by Ben on November 30, 2015 at 05:36 PM

    Nice solution :)

    Thank you for updating us in regards to the same and do let us know if you have any further questions that we can assist you with and we would be happy to do so :)

  • Profile Image

    Answered by NGHS on December 01, 2015 at 07:41 AM

    Thank you sir!

  • Profile Image
    JotForm Developer

    Answered by mert on December 01, 2015 at 10:03 AM

    You are most welcome. Apart from the Google Analytics, we have a built in solution called Form Analytics. It also keeps the stats of your forms.

    Below, you can find a guide about how to use it: