function trackLegacyChannels(channelParam,marketingsvc) {
       
       if(typeof tracker=='undefined')
         return;
       
        var url = '' + window.location;
        if (url.match(/@/)) {
            jQuery.url.setUrl(url.replace(/@/g, "%40"));
        }
        var c_name = jQuery.url.param("c_name");
        if (typeof c_name != 'undefined') {
                return;
        }
        if(typeof channelParam=='undefined' || jQuery.trim(channelParam).length==0||channelParam=='direct')
           return;
        qs = "c_name="+channelParam;
        trackLegacyVisit(tracker,qs,marketingsvc);
        var cookieStr = tracker.createMktCookieStr(qs);
        tracker.writeMktCookie(cookieStr);
        tracker.writeTrackCookie("track","1");
        jQuery(document).ready(function() {
            tracker.appendJumpParamsToForms();
        });
}

function trackLegacyVisit(tracker,channelParam,marketingsvc) {
    if ("1" == tracker.readColCookie("track")) {
        return;
    }
    
    var url = '' + window.location;
    if (url.match(/@/)) {
        jQuery.url.setUrl(url.replace(/@/g, "%40"));
    }
    // channel params
    var channelParams;
    channelParams = tracker.channelParams("", channelParam);
    
    var userId = jQuery.cookie('__col_visit');
    
    var port = "";
    var oldUrl = jQuery.url.attr("source");
    jQuery('script').each(function(i, item){
        if (item.src.indexOf("/marketing/api/2009/api.js") > 1 && jQuery.url.setUrl(item.src).attr("port") != null){
            port = ":" + jQuery.url.setUrl(item.src).attr("port");
        }
    });
    jQuery.url.setUrl(oldUrl);
     if(typeof marketingsvc =='undefined')
        marketing="//stage.marketing.citrixonline.com";
     else
         marketing="//"+marketingsvc+"marketing.citrixonline.com";
      
    
    

    url = location.protocol + marketing + port + "/marketing"
                  + "/api/visit"
                  + "/userid/" + userId
                  + "/domain/" + window.location.hostname
                  + "/productName/" + tracker.productId       
                  + "/channelparams/" + tracker.encode(channelParams)
                  + ".json?_method=POST&callback=?";
    
    var trackerThis = tracker;
    jQuery.getJSON(url,
        function(data) {
            tracker.userId = data.string;
           
            var opts = { path: '/', expires: 365, domain: trackerThis.subdomain};
            jQuery.cookie('__col_visit', tracker.userId, opts);
        });
}

