I'm trying to work with another companies google analytics code. Unfortunately I don't have much experience with it and only understand the basics of the code.
The following code I'm working with should be tracking cross browser clicks: (I've cut out most of the code and written the important pieces)
if (($(link).attr('href').indexOf('example.com') != -1) &&
(window.location.href.indexOf('example.com') == -1)) {
$(link).bind('click', function (l) {
if (typeof (_gat) == "object") {
l.preventDefault();
_gaq.push(['_link', $(link).attr('href')]);
}
});
}
Now the issue i'm encountering is the prevent default is now block all the external links from opening in a new window.
How can I modify this code and maintain the tracking so they still do?