Page referral code does not work

  • Profile Image
    Asked on May 23, 2012 at 06:55 PM


    I have tried to embed the script to know the URL from which page a form was completed  which i found here:


    However: if i  embed the following code below, the referrer field is not completed (stays empty) on my form mail.



    document.write("<script type="text/javascript" src="//" + window.location.href + "\"></" + "script>");



    Besides this, on top of my form it show a small piece of code : document.write("

    Anyone an idea what could be the problem? 


  • Profile Image
    Answered on May 23, 2012 at 07:41 PM

    Thank you for contacting us.

    There should be space between script and type "<script type".

    Please try with the following code:

    <script type="text/javascript">
    document.write("<scriptsrc=\"" + window.location.href + "\"></" + "script>");

    If you need any further assistance, please let us know.

  • Profile Image
    Answered on May 24, 2012 at 04:14 AM

    Worked like a charm!

    This solves a long standing problem for me!

    Thanks, you guys rock!