title: How do I set up Google Analytics to track outbound links? The official example doesn't work
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/13211120/how-to-track-clicks-on-outbound-links">How to track clicks on outbound links</a>  </p>
  </blockquote>
  
  
  
  <p>As described in <a href="http://support.google.com/analytics/bin/answer.py?hl=en&amp;answer=1136920" rel="nofollow noreferrer">the official documentation</a> I have included this piece of code in my <code>&lt;head&gt;</code> section:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
    function recordOutboundLink(link, category, action) {
      try {
        var myTracker=_gat._getTrackerByName();
        _gaq.push(['myTracker._trackEvent', category , action ]);
        setTimeout('document.location = "' + link.href + '"', 100)
      }catch(err){}
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>And have changed the link to this:</p>
  
  <pre><code>&lt;a href="http://www.example.com" onClick="recordOutboundLink(this, 'Outbound Links', 'example.com');return false;"&gt;
  </code></pre>
  
  <p>However still no events are shown up in the reports.</p>
  
  <p>What am I doing wrong?</p>