Ros Ros - 24 days ago 5x
Javascript Question

Google Analytics - Record Outbound Links - open new window

I have used the following link to record outbound links through google analytics. Is it possible to open the link in a new window?

<script type="text/javascript">
function recordOutboundLink(link, category, action)
try {
var myTracker=_gat._getTrackerByName();
_gaq.push(['myTracker._trackEvent', category , action ]);
setTimeout('document.location = "' + link.href + '"', 100)

<a href="" onClick="recordOutboundLink(this, 'Outbound Links', '');return false;">


edit, I forgot to add target="_blank":

I would do it this way tracking outbound links:

<a href="" target="_blank" onclick="_gaq.push(['_trackEvent','outgoing_links',''])">Link Text</a>