title: Firing 2 google analytics events with an outbound link
body: <p>I have outbound links like this in my html:</p>
  
  <pre><code>&lt;a href="http://www.example.com" class="gaLink1" 
  target="_blank" onCLick="ga_track_link('action', '123', 'abcde', 'fghij')"&gt; 
  &lt;img src="http://www.example.com/image.jpg" alt="image name" height="180" style="max-width:153px;max-height:150px;" /&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>So, When there is a click on this image, the link www.example.com should open in a new tab, since there is target="_blank". Also, the onCLick event will call the function ga_track_link which is defined as:</p>
  
  <pre><code>function ga_track_link(action, id, name, source) {
      _gaq.push(['_trackEvent', 'category 1', action, id+': '+name]);
      _gaq.push(['_trackEvent', 'category 2', 'example', source, 15]);
  }
  </code></pre>
  
  <p>This function is defined in the script section at the end of the html (inside the body section)</p>
  
  <p>I'm observing in GA, there both events are tracked (category 1 and 2), but the amount of times that both are tracked is not equal. Category 2 appears almost half of times, which makes me think that the 2nd event is not always being fired.</p>
  
  <p>I found this link <a href="http://support.google.com/googleanalytics/bin/answer.py?hl=en&amp;answer=55527" rel="nofollow noreferrer">http://support.google.com/googleanalytics/bin/answer.py?hl=en&amp;answer=55527</a>
  that suggests to put the function "ga_track_link" in the head section of the html and use a return False in the onClick function. </p>
  
  <p>According to some other answers like <a href="https://stackoverflow.com/questions/855360/when-and-why-to-return-false-in-javascript">When and why to &#39;return false&#39; in JavaScript?</a> , the return false statement would tell the event (onClick) not to be fired, which is not what I want, since I do want it to be fired but after my 2 GA events were fired.</p>
  
  <p>So, I have 3 questions:</p>
  
  <p>1) Is there any problem firing more than 1 GA event (with _trackEvent) on 1 click? What is the best way to do it?</p>
  
  <p>2) Why Google Analytics link above states that the function should be placed in the head section of the html?</p>
  
  <p>3) Can someone please clarify the "return false" statement's goal and how to use it correctly?</p>