Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google analytics events not showing up

New to google analytics so bear with me. I added the event tracking to my code, but when i check in the reporting behavior event tab it's blank. Here is my code.

  <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
    ga('create', 'UA-XXXXXXXXX', 'auto');
    ga('send', 'pageview');
  </script>

here is an example of my a tag

<a href="http://example.com/" target="_blank" class="app-logo" ga('send', 'event', 'Link', 'Click', 'example.com');>
like image 545
Zachary Almero Avatar asked Jul 11 '16 20:07

Zachary Almero


People also ask

Why are events not showing up on Google Analytics?

If you don't see any data at all in your Real-Time reports, the most likely cause is either in the Google Analytics tracking code or GA/GTM misconfiguration. You should check your tags in Google Tag Manager, Google Analytics filters, and also use browser extensions for debugging.

How long does it take for events to show up in Google Analytics?

Many of your reports and explorations can take 24-48 hours to process data from your website or app. You can use the Realtime and DebugView reports to confirm that you're collecting data from your website or app successfully.

Why Google Analytics is not working?

Another reason why your Google Analytics is not working is that it might be conflicting with another script on your webpage. If you have other scripts running on your website, make sure they don't use the same variables as Google Analytics.


1 Answers

In google-analytics, for the correct website, look on the "realtime/events" page and see if events are appearing there (they should appear here within a few seconds, after being triggered on your website).

If not, you might have added a filter, to filter out events generated by traffic from your own IP. You can find this filter under "admin" and then "all filters". If so, remove it (or temporarily change the IP-address, so it doesn't match). After that, generate a few events on your website and look again on the google-analytics page, under realtime traffic / events page.

If they work under realtime, it should also work in non-realtime (but it might take 24-48 hours to appear there!)

like image 149
kalmiya Avatar answered Sep 21 '22 23:09

kalmiya