Extend download link with custom events and evars

Gold Contributor
Gold Contributor

I would like to extend the autolink tracking (SiteCatalyst) with a custom event and some custom eVars.

 

I have configured my SiteCat tag with Auto link tracking.

 

Now if I click a PDF download link on my page a download request is sent to SC.

 

How can I extend the request with for example event7 and eVar5, eVar6 ?

 

At this moment I've got a jQuery onclick which populates the following UDO values:

linkTrackVars = "eVar5, eVar6, events";

linkTrackEvents = "event7";

 

But when adding these values onClick we're to late and the download link is already sent when these are available. (I have tested this by adding an extra request onClick. (utag.link(adv_data)). The data is sent in the extra request.

 

So is there a generic approach to add additional data to the request generated by auto link tracking?

3 REPLIES 3

Extend download link with custom events and evars

Employee Emeritus

Hey Marcel,

 

There are a few ways to accomplish this. One way would be to use a SiteCat plugin but that would limit your tracking to only SiteCat. It would look something like this and requires the doPlugins function within a JS extension.

 

/* Plugin Config */

s.usePlugins=true

function s_doPlugins(s) {

if(s.linkType=="d"){

s.linkTrackVars = "eVar5,eVar6,events";

s.linkTrackEvents = "event7";

s.events="event7";

}

}

s.doPlugins=s_doPlugins

 

Alternatively you could make this vendor neutral by using an extension in TIQ to set a global variable on-click or mousedown called event_type. Then, in the mapping toolbox of SiteCat when event_type equals something like "download" you can set your events and evars accordingly.

 

Hope this helps. Let me know if you have any questions.

Extend download link with custom events and evars

Gold Contributor
Gold Contributor
Hi James, This solution worked for me! Thanks for the help! Yours, Marcel

Extend download link with custom events and evars

Employee Emeritus
Perfect! Happy to help!
Public