JavaScript window.open pop-up error with Google Analytics API
<p>So, I know that similar questions have been asked before, however I think this case is quite different.</p>

<p>I am building an ad management system, and to save time I thought on using the Google Analytics API to track clicks. The JS-code I am using is the standard one:</p>

<pre><code>function recordOutboundLink(link, category, action) {
    _gat._getTrackerByName()._trackEvent(category, action);
    setTimeout('window.open("' + link.href + '")', 100);
}
</code></pre>

<p>And the onclick-code is like this:</p>

<pre><code>&lt;a href="#advertUrl" target="_blank" rel="nofollow" onClick="recordOutboundLink(this, 'Advert', 'Title of ad');return false;"&gt;
</code></pre>

<p>However, when the user clicks a link, the user recieves a notice that a pop-up has successfully been blocked. Now, this only happen is certain circumstances:</p>

<p>The user access the page – he/she clicks on an ad, and a blocked pop-up notice is displayed. However, whether the user chooses to continue to block pop-ups or not doesn't matter.</p>

<p>If the user access the same page again, and clicks the same ad, nothing happens. But if he/she clicks a new one, the same pattern occurs...</p>

<p>I've only been able to see this exact pattern in Chrome (version 14 and 15 beta, both Mac and Win). Also tested in Opera; no blocked pop-ups. And, correct me if I'm wrong – if a window.open is trigger with an onclick-event, the browser shouldn't even block it, correct?</p>

<p>Need some serious help on solving this. Opening the ads in a new window is a must. </p>
