...
Code Block | ||
---|---|---|
| ||
/** * 1 -> Capture click on the desired product * 2 -> Avoid default action (redirect to destination url) * 3 -> Execute trackClick function with the desired callback (including url redirection) */ jQuery('a#myLink').click(function(){ event.preventDefault(); var myURL = this.href; var title = this.title; var productId = this.prodID; var options = { lang: LANGUAGUE, scope: SCOPE, store: STORE, catalog: CATALOG, section: SECTION, user: USER_ID, session: SESSION_ID }; empathyTAG.trackClick('test', 1, 3, this.prodID, this.title, this.href, options, function(){ //Add your code here document.location.href = myURL; }); }); |
...