I’m having trouble with my Google Analytics setup. I can see event data in the Real Time reports but nothing shows up in the Behavior > Events > Overview section. I’m using the old version of Analytics with this tracking code:
<script type='text/javascript'>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-12345678-1']);
_gaq.push(['_setDomainName', 'mysite.com']);
_gaq.push(['_trackPageview']);
(function() {
var tracker = document.createElement('script');
tracker.type = 'text/javascript';
tracker.async = true;
tracker.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var firstScript = document.getElementsByTagName('script')[0];
firstScript.parentNode.insertBefore(tracker, firstScript);
})();
</script>
<script>
$(document).ready(function() {
$('.action-btn').each(function(){
$(this).text($(this).attr('data-action'));
});
$('.action-btn').on('click', function(){
var actionName = $(this).attr('data-action');
_gaq.push(['_trackEvent', 'Button_Clicks', actionName, 'homepage']);
console.log('Event tracked: ' + actionName);
});
});
</script>
<div class='button-container'>
<button class='action-btn' data-action='PRESS_HOME'></button>
<button class='action-btn' data-action='PRESS_ABOUT'></button>
<button class='action-btn' data-action='PRESS_CONTACT'></button>
<button class='action-btn' data-action='PRESS_SERVICES'></button>
<button class='action-btn' data-action='PRESS_PORTFOLIO'></button>
</div>
The real time events work fine but I need them to show in the main reports. What am I missing here?