- In order to track a variable/event in an
s.tl
call, you need to declare them inlinkTrackVars
andlinkTrackEvents
. The only exception ispageName
, which will get tracked whether or not you declare it. linkTrackEvents
is a comma delimited list of any events you want to track (note: you should not have spaces between the commas).linkTrackVars
is a comma delimited list of variables you want to track. For example, you can see in your own code how you are trackingevent27
. Note that for events, you must declareevents
inlinkTrackVars
(which you did).- In your
s.events
you have"events27"
when it should be"event27"
(no"s"
). - Also, in your
s.tl
call passthis, 'o'
- You don't need to put
event27
inlinkTrackVars
, onlylinkTrackEvents
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');
}