title: How to identify and fix cause of 'not set' Event Label in Event report in Google Analytics?
body: <p>Custom event tracking is working but includes a lot of 'not set' Event Label entries in the Google Analytics event report.</p>
  
  <p>On our WordPress site we use MonsterInsights Google Analytics plugin (working fine) - we are not using Google Tag Manager. In our theme we leverage this plugin's implementation of the Google Analytics (GA) tracking code to fire a custom event on specific links/buttons. These links either show the contents of the linked page in Colorbox (stays on the calling page) or opens a new window/tab. The code below correctly fires and is tracked in GA - we can navigate to 'Behaviour > Events > colorbox > Play' and see a list of the link/button Titles (Event Label).</p>
  
  <p>However, for some 25% of entries in the GA Events Report there is also a 'not set' listing where only the Event Label hasn't been set.</p>
  
  <p>I have checked our entire website and every occurrence that uses the class 'cbPlayGame' correctly has the 'title' attribute set on the 'a' tag.</p>
  
  <p>Searching the internet keeps coming up with bots and spiders as the cause of 'not set', but quite some time ago in Google Analytics we set up filters to exclude ghost bots etc.</p>
  
  <p><strong>What might be the cause of these 'not set' entries and could any of them be recorded for genuine users of the website?</strong></p>
  
  <p><strong>Is the jQuery code below incorrect or known to not work properly on particular browsers/devices?</strong></p>
  
  <p>Other questions on here all seem to talk about Google Tag Manager which we don't use or filtering bots which we already do.</p>
  
  <p>Sample link/button:</p>
  
  <pre><code>&lt;p class="normalBtn playbtn cbPlayGame"&gt;&lt;a href="***URL Removed***" title="3D Violin" class="size720x650"&gt;Play &lt;span class="hideele"&gt;3D Violin&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
  </code></pre>
  
  <p>jQuery GA code:</p>
  
  <pre><code>try {
      $j('.cbPlayGame a').click(function(){
          console.log('.cbPlayGame click fired - '+$j(this).attr('title')+'.');
          __gaTracker('send', {
              hitType: 'event',
              eventCategory: 'colorbox',
              eventAction: 'Play',
              eventLabel: $j(this).attr('title')
          });
          console.log('.cbPlayGame ga event sent.');
      });
  }
  catch(err) {console.log(err);}
  </code></pre>
  
  <p>EDIT - Updated jQuery code:
  Now retrieve the link title/href and test if it is populated (not empty, undefined etc) before sending it via __gaTracker.</p>
  
  <pre><code>try {
      $j('.cbPlayGame a').click(function(){
          var aTitle = $j(this).attr('title') || this.href;
          console.log('.cbPlayGame click fired aTitle - '+aTitle+'.');
          if(aTitle) {
              __gaTracker('send', {
                  hitType: 'event',
                  eventCategory: 'colorbox',
                  eventAction: 'Play',
                  eventLabel: aTitle
              });
              console.log('.cbPlayGame ga event sent.');
          }
          else {
              console.log('.cbPlayGame ga event NOT sent.');
          }
      });
  }
  catch(err) {console.log(err);}
  </code></pre>