I am using the Tealium Custom Container tag to add functions that I would like to call, specifically as onClick actions throughout my websites. These functions look like this:
function pageModules( obj, detail ) {
var s=s_gi ("the report suite here");
pageTitle = "the page title here";
pageUrl= "the page URL";
someOtherVariable= "other variable mapping";
var ostring = pageTitle+" | "+detail.action+" : "+detail.position;
s.linkTrackVars="eVar35,events";
s.linkTrackEvents="event25";
s.eVar35=ostring;
s.events="event25";
s.tl(true, 'o', ostring);
}
Basically, these are custom link tracking functions that I will then call through an onClick action. I have gotten this to work by writing in the report suite ID and leaving the variables with sample text. But what I can not do is figure out:
- How do I pass variables that I have mapped in my Data Layer (these are all configured as JavaScript Variables)? Do I have to add them to the tag? How do I map them and how do I actually call them in my function above?
- In what part of the Tealium Custom Container should I place my function, and any additional code that I may be missing? I have this entire function currently in the /* Start Tag Library Code */ area.
Thank you!
-André Moraes
... View more