title: Why doesn't this event tracker work?
body: <p>I'm trying to record the url of a page when a user clicks a submit button using google analytics event trackers. </p>
  
  <p>I have found a javascript function that should do the job but i cannot get it to work. Any suggestions?</p>
  
  <p>I have dropped this is the  underneath the google analytic s snippit.</p>
  
  <pre><code>function recordOutboundLink(link, category, action) {  
      try {  
          var myTracker=_gat._getTrackerByName();  
          _gaq.push(['myTracker._trackEvent', ' + category + ', ' + action + ']);  
          setTimeout('document.location = "' + link.href + '"', 100)  
      }catch(err){}  
  }  
  </code></pre>
  
  <p>And Added this to the sumbit button.</p>
  
  <pre><code>&lt;a href="/confirmation.html" onClick="recordOutboundLink(this, 'Outbound Links', 'example.com'); return false;"&gt;
  </code></pre>
  
  <p>but google anayltics isn't recording anything.</p>