I think I have this working now so thought I'd share.
Also you may be able to tell me if it's complete rubbish.
I changed the getSlideHTML function like thus;
Code:
getSlideHTML: function (imgelement) {
var llhtml = (imgelement[4]) ? '" onClick="trackOutboundLink(this, \'' + imgelement[4] + '\', \'' + imgelement[5] + '\'); return false;" ' : ''
var layerHTML = (imgelement[1]) ? '<a href="' + imgelement[1] + '" target="' + imgelement[2] + llhtml + ' >\n' : '' //hyperlink slide?
layerHTML+='<img src="'+imgelement[0]+'" style="border-width:0;" />\n'
layerHTML+=(imgelement[1])? '</a>\n' : ''
return layerHTML //return HTML for this layer
},
So that if you use
Code:
imagearray: [ ["path_to_image", "optional_url", "optional_linktarget", "optional_description", "optional_analytics_group", "optional_analytics_item"] ]
It will include the above onClick around the link.
You also need to include this
Code:
function trackOutboundLink(link, category, action) {
try {
_gaq.push(['_trackEvent', category , action]);
} catch(err){}
setTimeout(function() {
window.open(link.href) ;
}, 100);
}
on your page, along with any other Google analytics tracking code as required.
Hope this helps someone.
S.
Bookmarks