title: Using multiple google analytics events on the same page
body: <p>I am trying to create a script where multiple events are fired and sent to google analytics based on the adverts showing on a page. So far I came up with this however only the first, leader board banner is working while the rest are not. I am sure my code can be simplified as I am no expert in jquery but the issue are the events since neither the click events are working. When I include an alert for debugging this gets fired so not sure whats wrong with my code.</p>
  
  <pre><code>&lt;!-- Tracking --&gt;
  &lt;script&gt;
  jQuery(document).ready(function($) {
  
  //leaderboard
  $(".ad_leaderboard").ready(function() {
      ga('send', 'event', '&lt;?php echo $GLOBALS['ad_leaderboard_term']; ?&gt;', 'view', '&lt;?php echo $GLOBALS['ad_leaderboard_title']; ?&gt;');
  });
  
  $(".ad_leaderboard").click(function() {
      ga('send', 'event', '&lt;?php echo $GLOBALS['ad_leaderboard_term']; ?&gt;', 'click', '&lt;?php echo $GLOBALS['ad_leaderboard_title']; ?&gt;');
  });
  
  //medium-rectangle
  $(".ad_medium_rectangle").ready(function() {
      ga('send', 'event', '&lt;?php echo $GLOBALS['ad_medium_rectangle_term']; ?&gt;', 'view', '&lt;?php echo $GLOBALS['ad_medium_rectangle_title']; ?&gt;');
  });
  
  $(".ad_medium_rectangle").click(function() {
      ga('send', 'event', '&lt;?php echo $GLOBALS['ad_medium_rectangle_term']; ?&gt;', 'click', '&lt;?php echo $GLOBALS['ad_medium_rectangle_title']; ?&gt;');
  });
  
  //skyscraper
  $(".ad_skyscraper").ready(function() {
      ga('send', 'event', '&lt;?php echo $GLOBALS['ad_skyscraper_term']; ?&gt;', 'view', '&lt;?php echo $GLOBALS['ad_skyscraper_title']; ?&gt;');
  });
  
  $(".ad_skyscraper").click(function() {
      ga('send', 'event', '&lt;?php echo $GLOBALS['ad_skyscraper_term']; ?&gt;', 'click', '&lt;?php echo $GLOBALS['ad_skyscraper_title']; ?&gt;');
  });
  
  //halfbanner
  $(".ad_halfbanner").ready(function() {
      ga('send', 'event', '&lt;?php echo $GLOBALS['ad_halfbanner_term']; ?&gt;', 'view', '&lt;?php echo $GLOBALS['ad_halfbanner_title']; ?&gt;');
  });
  
  $(".ad_halfbanner").click(function() {
      ga('send', 'event', '&lt;?php echo $GLOBALS['ad_halfbanner_term']; ?&gt;', 'click', '&lt;?php echo $GLOBALS['ad_halfbanner_title']; ?&gt;');
  });
  });
  &lt;/script&gt;
  </code></pre>