Site Catalyst custom events

Bronze Contributor
Bronze Contributor
In the site catalyst documentation at https://developer.omniture.com/en_US/content_page/sitecatalyst-tagging/c-add-a-custom-event, site catalyst recommend that custom events (eg link clicked, video played, item "liked" in social media) are tracked with the implementation like: function sendCallCenterData() { s=s_gi(s_account); s.events='event1'; s.eVar1='some text' s.eVar2='some other text' s.prop2=12345 s.linkTrackEvents='eVar1,eVar2,prop2,event1'; s.tl(true,'o','Call Center Link'); } Is there an example or best practices on how to implement this in Tealium? (preferably without using a heap of Javascript Code extensions) Thanks Sandra
7 REPLIES 7

Site Catalyst custom events

Tealium Employee

Hi Sandra,

So what you would do is call utag.link() passing in the data that you wanted to send. Then inside Tealium you would use set data values extension to set the data then map the data in the tag. To fill linkTrackVars, if you define it as a datasource called linkTrackVars you can then set it to the values that you want. So in your example 'eVar1,eVar2,prop2,event1';.

 

You might want to restrict the extension using the conditions option, so that it only works for the data that you have passed in.

 

Hope this makes sense,

Adrian

Ask me anything Tealium related or TypeScript/JavaScript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.

Site Catalyst custom events

Gold Contributor
Gold Contributor

If you are using the latest SiteCatalyst template you do not need to set linktrackvars. We simply use set extensions and use the conditions to set the data source sc_events, the data sources that are mapped to the appropriate props and evars and the data source link_text.

You need to set a data source for sc_events and link_text.

 

Our extension looks something like this:

When URL contains (ignorecase) "searchresults.asp"

Set searchterm (mapped to prop2 & eVar2) = keyword value

Set link_text = Search

Set sc_events = (JS) u.addEvent("event2")

 

Yours I would imagine would look something like this:

When button click contains (ignorecase) "Call Center"

Set datasource1 (mapped to prop1) = some text

Set datasource2 (mapped to eVar2) = some other text

Set link_text = Call Center Link

Set sc_events = (JS) u.addEvent("event1")

Site Catalyst custom events

Employee Emeritus

Adding to Adrian's comment.

 

For a link or click event you can use a jQuery onHandler Extension and select link in the Tracking Event drop down. For reference, selecting "link" will call the s.tl() function and "view" will call the s.t() function.

 

You can then define the variables you would like sent in the Set section at the bottom of the extension. Once you have the variables defined you can them map them within the Mapping Section of the SiteCatalyst Tag.

 

For Videos this can be a little trickier depending on who your video provider is. This will most likely require some javascript to listen for certain events that take place.

 

As far as linkTrackVars and linkTrackEvents, our template will automatically set those values depending on what values have been mapped. However, this feature is only available in the H25 and H26 version of the SiteCatalyst Tag.

Site Catalyst custom events

Gold Contributor
Gold Contributor

Jared,

Can you explain how Set section works? I need to get a value using jQuery code:

jQuery('.chat').attr('name')

From drop down I can select "JS code" but it doesn't work if I just paste the jQuery code. It passes "jQuery('.chat').attr('name')" as a variable value.

Site Catalyst custom events

Employee Emeritus
Thomas, To keep things organized and make it able to find via search, can you create a new question and I can address it there? Thanks

Site Catalyst custom events

Gold Contributor
Gold Contributor
Hi Adrian, if you define "linkTrackVars" in datasource and you populate it, this overwrite what utag.link automatically generates?

Site Catalyst custom events

Employee Emeritus
Yes, if you set a "UDO Variable" type Data Source called "linkTrackVars" it will be used to overwrite the automatically generated value in the SC tag template.
Public