Is there a simple, universal outbound click tracking method for JQuery / Javascript? -
i'm looking way of tracking outbound clicks web page using javascript/ jquery without modifying of existing page code. solution must work frames, iframes, content different domains, ajax etc.
perhaps, javascript wrong technology universal solution. if so, please let me know better.
it's easy enough capture clicks on external links.
$(document).ready(function() { $("a[@href^=http]").each(function(){ if(this.href.indexof(location.hostname) == -1) { // handle click here } }); });
getting work iframes little trickier. iframe should reside same domain due same origin policy. if should able change css selector above $("#iframe_id").contents().find("[@href^=http]")
Comments
Post a Comment