Inject javascript into form

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


    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://') + '';
      var a = document.getElementsByTagName('script')[0]; a.parentNode.insertBefore(b, a);
    <!-- End Klaviyo -->
  • Profile Image
    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: 

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

    Please inform us if you need further assistance.