Inject javascript into form

  • Profile Image
    art_crate
    Asked on June 27, 2015 at 02:05 AM

    Hello,

    I am trying to inject a tracking code from Klaviyo into my form. If the only way to do this is download the source code, then upload it to my site—could you please assist me, I am using squarespace.

     

    <!-- Start Klaviyo -->
    <script type="text/javascript">
      var _learnq = _learnq || [];
     
      _learnq.push(['account', 'gQkwid']);
     
      (function () {
      var b = document.createElement('script'); b.type = 'text/javascript'; b.async = true;
      b.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'a.klaviyo.com/media/js/analytics/analytics.js';
      var a = document.getElementsByTagName('script')[0]; a.parentNode.insertBefore(b, a);
      })();
    </script>
    <!-- End Klaviyo -->
     
     
    Thanks!
  • Profile Image
    Shadae
    Answered on June 27, 2015 at 07:07 AM

    Hi art_crate,

    Yes it is only possible to add Javascript coding to your form if you grab the full source code of your form and add the code:

    http://www.jotform.com/help/104-How-to-get-the-Full-Source-Code-of-your-Form 

    You would then place the code into your code editor and add your script.

    Please inform us if you need further assistance.