title: How to Capture Link Text on Event Click with Google Tag Manager
body: <p>I want to create a GTM Trigger and Tag to capture the link text and send it to Google Analytics as an event.</p>
  
  <p>I would like to record an event click in Google Analytics anytime the visitor clicks on the <code>a.accordion-title</code> thus setting <code>aria-selected="true"</code>. I would like the event to show in Google Analytics with the Link Text -- in my markup below it would be "Accordion 1 Label", or "Accordion 2 Label", or "Accordion 3 Label" so I could tell which accordion element was clicked.</p>
  
  <p>Here is my HTML Markup:</p>
  
  <pre><code>&lt;ul class="accordion" data-accordion="jc8vp5-accordion" data-multi-expand="true" data-allow-all-closed="true" role="tablist"&gt;
  
    &lt;li class="accordion-item" data-accordion-item=""&gt;
      &lt;a href="#" class="accordion-title" aria-controls="1y2mly-accordion" role="tab" id="1y2mly-accordion-label" aria-expanded="false" aria-selected="false"&gt;Accordion 1 Label&lt;/a&gt;
      &lt;div class="accordion-content" data-tab-content="" role="tabpanel" aria-labelledby="1y2mly-accordion-label" aria-hidden="true" id="1y2mly-accordion" style="display: none;"&gt;Accordion 1 content...&lt;/div&gt;
    &lt;/li&gt;
  
    &lt;li class="accordion-item" data-accordion-item=""&gt;
      &lt;a href="#" class="accordion-title" aria-controls="kyorlu-accordion" role="tab" id="kyorlu-accordion-label" aria-expanded="false" aria-selected="false"&gt;Accordion 2 Label&lt;/a&gt;
      &lt;div class="accordion-content" data-tab-content="" role="tabpanel" aria-labelledby="kyorlu-accordion-label" aria-hidden="true" id="kyorlu-accordion"&gt;Accordion 2 content...&lt;/div&gt;
    &lt;/li&gt;
  
    &lt;li class="accordion-item" data-accordion-item=""&gt;
      &lt;a href="#" class="accordion-title" aria-controls="qt95rx-accordion" role="tab" id="qt95rx-accordion-label" aria-expanded="false" aria-selected="false"&gt;Accordion 3 Label&lt;/a&gt;
      &lt;div class="accordion-content" data-tab-content="" role="tabpanel" aria-labelledby="qt95rx-accordion-label" aria-hidden="true" id="qt95rx-accordion"&gt;Accordion 3 content...&lt;/div&gt;
    &lt;/li&gt;
  
  &lt;/ul&gt;
  </code></pre>
  
  <p>To help me get started, is this the proper trigger to be setup?</p>
  
  <ul>
  <li>Trigger type = Click - All Elements</li>
  <li>This trigger fires on = Some Clicks</li>
  <li>Fire this trigger when an Event occurs and all of these conditions are true = Click Classes equals <code>accordion-title</code></li>
  </ul>
  
  <p>Thank you</p>