How can I run a script inside a form?

  • Profile Image
    kauseway
    Asked on January 13, 2015 at 04:41 PM

    I am tracking my users movement using mouseflow. But it cant track the form since it is an iframe. They said I need to paste their script code inside the html above the </body> tag.  How can I do that?

     

    https://secure.jotformpro.com/form/50005155818954

    https://naturalcarecleaningservice.com/book-now-checkout/

     

    <script type="text/javascript">

       var _mfq = _mfq || [];

       (function() {

           var mf = document.createElement("script"); mf.type = "text/javascript"; mf.async = true;

           mf.src = "//cdn.mouseflow.com/projects/4f3f23ed-e44c-4c89-ac89-309ce3c4574e.js";

           document.getElementsByTagName("head")[0].appendChild(mf);

       })();

    </script>

  • Profile Image
    raul
    Answered on January 13, 2015 at 06:08 PM

    Based on you what you're mentioning, I suggest that you use the full source code of your form to embed it in your website. This way the script will also be able to capture the movements in it.

    However, please note that using this method requires you to manually update the code of your form in your site every time you make changes in it.

    Hope this helps.

    Let us know if you need further assistance.
    Thanks.