I'm trying to track specific events on my website however I can't see that the events are working.

I've got the following Google code in the section of my site which suggests I'm using gtag.js:

<script async src="https://www.googletagmanager.com/gtag/js?id=X-XXXXXXXXXX"></script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'X-XXXXXXXXXX');

I'm then using this code which is inside my tag to try and track the event:

    onclick="gtag('event', 'Click', {'event_category':'Button','event_label':'Button Click'});"

It could be that it's working but I'm looking in the wrong place in Analytics. Any help would be much appreciated, thanks!

  • Was the problem solved?
    – Tal
    Apr 6 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.