URGENT: Tracking code within a form field

  • Profile Image
    Asked on May 30, 2012 at 11:30 AM

    PLEASE HELP - I need and answer on this as soon as possible.

    We have the following tracking code implemented on our site:

    <script type="text/javascript">
    function appendkeycode()
    // Declare Variables
    var adminkeycode = 'xxxxxx_x';
    var linkurl = 'http://www.cloudday2.com';
    var linktext = 'Cloud Day 2';

    // Insert the keycode
    var sid_pattern= /^[0-9]{6}[_][0-9]{1,4}$/;
    var pageurl=location.href;
    var sid="";
    if(pageurl.indexOf("sid=")!= -1){
    var checkextraval = sid.search("&");
    if(checkextraval != -1)
    if(sid=="" || !sid_pattern.test(sid))
    document.getElementById("link1").innerHTML = '<a target="_blank" href=' + linkurl + '?sid='+sid+'>' + linktext + '</a>';


    Along with a body tag of <body onload="appendkeycode();">

    This will allow a tracking code to be appended onto the URL for specific contacts.

    I need to have that tracking code added as a field to the form so I can include it in reporting.

    I read on the forums that using a hidded field is the direction I need to go with this. 

    Can someone please let me know if this is how it should be handled, and if so what should be put in that field as far as "ID" and/or default value for it to work properly?

    Thank you!

  • Profile Image
    Answered on May 30, 2012 at 02:41 PM


    I have answered your question on this thread