My RAW short embed code works perfect with my site.

  • Profile Image
    brycelw
    Asked on July 02, 2012 at 06:48 PM

    My RAW short embed code works perfect with my site. Now I need to track the specific URL where a submission came from. I am confused because my short embed for my form is already a javaScript code. This is how it starts.



    This is a re-post of a comment on Capture the Page URL Where the Form is Embedded

  • Profile Image
    jeanettebmz
    Answered on July 02, 2012 at 06:49 PM

    Can you please provide us with the link where the form is embedded?

    Thanks

  • Profile Image
    brycelw
    Answered on July 02, 2012 at 06:51 PM

    its squarespace.com. Im looking for the easiest way to track exactly what URL the submissions are coming from as this same form is embedding on every page of my site.

    this is my embed code

  • Profile Image
    jeanettebmz
    Answered on July 02, 2012 at 09:11 PM

    Here are the instructions: 1.  Insert a hidden box to your form, name it to something like "referrer" or "website". (Please note that your hidden box name (e.g. referrer) will be used later in formulating your URL parameter.)

    2.  Get your form's script code.  In your case it will be :

    <script type="text/javascript" src="http://www.jotform.us/jsform/21814747300145

    "></

    script>

    ======================================

    Note that I have replaced  http://form  by http://www at the beggining of your form's link

    ======================================

    4.  Insert a backslash in front of each double quote

    <script type="text/javascript" src=\"http://www.jotform.us/jsform/21814747300145

    \"></

    script>

     

    4.  Append ?referrer= after your form ID (if your hidden box name is referrer) .To make this short, this URL parameter depends on your hidden box name.

    <script type="text/javascript" src=\"http://www.jotform.us/jsform/21814747300145?referrer=

    \"></

    script>

    5.  Copy the sliced codes onto theJavaScript code below (be careful not to miss the double quotes): 

    <scripttype="text/javascript">
    document.write("
    PART 1 GOES HERE" + window.location.href + "PART 2GOES HERE" + "PART 3GOES HERE");
    </script

     SO THE FINAL CODE WOULD BE :

    <scripttype="text/javascript">
    document.write("
    <scriptsrc=\"http://form.jotform.com/jsform/
    21814747300145
    ?referrer=" + window.location.href + "\"></" + "script>");
    </script>
     

    6.  Embed the edited codes onto yourpages.

    The URL of the page where the form is submitted will be stored in a hidden field which will be displayed in your form's  email alerts and submissions page.

    Best regards

    Jeanette

  • Profile Image
    brycelw
    Answered on July 05, 2012 at 03:40 PM

    Hi,

    thanks for your effort trying to help me solve this problem. I am trying to follow the steps accordingly but the final code does not reflect the modified sections in steps 2-4. I tried myself but when I place the parts into the javaScript code where indicated I still get an error. All that appears is...document.write("

    Is this the only way to track URL from a submission? Is Squarespace not compatible with this type of code modification? Would love to get this working somehow someway!

  • Profile Image
    idarktech
    Answered on July 05, 2012 at 10:43 PM

    @brycelw,

    This may also help. The code is much cleaner and lesser than the first one ;)

    http://www.jotform.com/help/60-How-to-find-out-the-address-of-the-page-from-which-a-submission-came

    Hope this works for you. Update us here if you run into any problems. Thank you.

  • Profile Image
    brycelw
    Answered on July 06, 2012 at 10:28 AM

    Hey again,

    I originally got this method with the source code working perfectly. The problem is that when the source code is used, it bugs out my Squarespace slideshows for some wierd reason. They looked into it and told me the code was "too advanced" for their platform thats why the slideshows were malfunctioning.

    When I use the short embed code my slideshows and form works perfect but then I cannot get the URL tracking to work! Please help! Is there an alternate way to track URL with the short embed code?

  • Profile Image
    Mike_T
    Answered on July 06, 2012 at 06:33 PM

    Please try the following code:

    <script type="text/javascript">
    document.write("<script src=\"http://form.jotformeu.com/jsform/21876681545363?referrer=" + window.location.href + "\"></" + "script>");
    </script>

    Where my test form ID 21876681545363  should be replaced with your form ID.

    Here is the same code on a screenshot:

  • Profile Image
    Mike_T
    Answered on July 06, 2012 at 06:40 PM

    You will also need to replace the domain in provided above code example. Your form is on a jotform.us domain, so you should place something like the following form URL:

    http://form.jotform.us/jsform/form_id_here