javascriptadobe-analyticswebsite-metrics

omiture SiteCatalyst - tracking s.channel in an onclick function


I have a function that tracks custom events. I would like to set s.channel in the function, but so far no success. It seems that s.channel is set through onload only? Is it possible to capture s.channel in the onClick function?

Here is my sample code.

function customLinks() {
    s.channel='CHANNEL VALUE'; //<=== this is not working
    s.events = 'events27';
    s.linkTrackVars = 'events, event27';
    s.linkTrackEvents = 'event27';
    s.tl(this.'o','Custom Link Click');    
}

Solution

  • So overall, this is what your function should look like:

    function customLinks() {
        s.channel='CHANNEL VALUE'; //<=== this is not working
        s.events = 'event27';
        s.linkTrackVars = 'events,channel';
        s.linkTrackEvents = 'event27';
        s.tl(this,'o','Custom Link Click');    
    }