title: Use onclick event in parent or child element?
body: <p>A little back story to get my situation:
  My colleague who monitors the GA stuff tells me it isn't firing when trying to track how many are clicking on what, on our website. Now I don't have access to the google account to check if my changes are working or not and she's currently sick (and no my company doesn't want GA accounts being shared for whatever reason)</p>
  
  <p>So I thought I'd come here and ask while I wait. Currently the GA was set up like this, and I wanted to know if it matters where the onclick is? Should it be in the anchor tag in this situation? or leaving it in that div is okay?</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;table&gt;
    &lt;tr&gt;
       &lt;td&gt;&lt;div onclick="ga('send', 'event', 'Participant_Centre', 'Click', 'PledgeSheet');"&gt;&lt;a href="this_tool" target="_blank"&gt;Pledge Sheet&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
  
       &lt;td&gt;&lt;div onclick="ga('send', 'event', 'Participant_Centre', 'Click', 'StepByStepGuide');"&gt;&lt;a href="this_tool" target="_blank"&gt;Step by Step Guide&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
  
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;div onclick="ga('send', 'event', 'Participant_Centre', 'Click', 'SampleBudget');"&gt;&lt;a href="this_tool" target="_blank"&gt;Sample Budget&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
      &lt;td&gt;&lt;div onclick="ga('send', 'event', 'Participant_Centre', 'Click', 'LawnSign');"&gt;&lt;a href="this_tool" target="_blank"&gt;Lawn Sign&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;div onclick="ga('send', 'event', 'Participant_Centre', 'Click', 'EventPlanningChart');"&gt;&lt;a href="hthis_tool" target="_blank"&gt;Event Planning Chart&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
      &lt;td&gt;&lt;div onclick="ga('send', 'event', 'Click', 'ParticipantCentre', 'FundraisingThermometer');"&gt;&lt;a href="hthis_tool" target="_blank"&gt;Fundraising Thermometer&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I don't know who made or set it up this way but it looks wrong to me, mainly because I don't put divs inside a td because of layout problems.</p>
  
  <p>What I changed it to is this:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div class="container"&gt;
     &lt;div class="col-lg-12"&gt;
        &lt;div class="col-md-3"&gt;
          &lt;a href="this_tool" target="_blank" onclick="ga('send', 'event', 'Participant_Centre', 'Click', 'PledgeSheet');"&gt;Pledge Sheet&lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="col-md-3"&gt;
          &lt;a href="this_tool" target="_blank" onclick="ga('send', 'event', 'Participant_Centre', 'Click', 'StepByStepGuide');"&gt;Step by Step Guide&lt;/a&gt;
            &lt;/div&gt;
  [...]
  </code></pre>
  
  <p>Is this a better set up? could that be why it wasn't firing? The GA code itself is correct as we used it before for other pages, those pages had it set up a little different, like this (but still targeted the child element span):</p>
  
  <pre><code>        &lt;li data-toggle="collapse" data-target=".navbar-collapse"&gt;
                              &lt;a class="navLink" href="website" target="_blank"&gt;&lt;span class="navTextWhite" onclick="ga('send', 'event', 'VolunteerHomepage', 'navbar', 'signup');"&gt;Sign me up!&lt;/span&gt;&lt;/a&gt;
                          &lt;/li&gt;
  </code></pre>
  
  <p>Because I saw that ^ I wanted to know if it mattered whether the onclick was in the parent or child element for GA tracking.</p>
  
  <p>Thank you for your time!</p>