Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Google Analytics - How to manually Track Clicks on Outbound Links


you want to use the tracking feature of Google Analytics to track all clicks on outbound links from your site, however, you also want those outbound links to open a new window...
If you simply follow the instructions to track outbound links you will discover that your links will no longer open in a new window (regardless of whether you are using Javascript or target="_BLANK" to open the window.

And here's the solution:


Apply the javascript to you hyperlink as usual...
your link text
...but modify the tracking code as follows...
function recordOutboundLink(link, category, action) {
try {
var pageTracker=_gat._getTracker("XX-XXXXXXX-XX");
pageTracker._trackEvent(category, action);
setTimeout('document.location = "' + link.href + '"', 100;window.open(this.href))
}catch(err){}
}
(Don't forget to replace XX-XXXXXXX-XX with your tracking code)
...and that's all — Outbound links with Google Analytics tracking and opening in a new window



This post first appeared on Free SEO Articles, Google SEO Tips, SEO Tools, SEO, please read the originial post: here

Share the post

Google Analytics - How to manually Track Clicks on Outbound Links

×

Subscribe to Free Seo Articles, Google Seo Tips, Seo Tools, Seo

Get updates delivered right to your inbox!

Thank you for your subscription

×