Search code examples
javascriptangulargoogle-analyticsgoogle-analytics-apigoogle-analytics-filters

Which report do we use for Google Analytics custom triggered events?


I'm created a method that will send a custom event to Google Analytics and it looks like this:

  uaClick2() {
    console.log("CLICKED UA 2")
    gtag('config', 'UA-146420424388-3', {
      'button_click': 'ua2'
    })
  }

When I click the button I see the gtag firing. Where in the Google Analytics console can I look for these events.

I tried clicking on Report tabs (Realtime, Audience, Acquisition, etc.) but I don't see any reporting with the custom button_click event nor the number of times that the event has occurred.


Solution

  • Your syntax to send an event is wrong.

    To send Google Analytics Events on a web page where the global site tag has been added, you need to use the following syntax:

    gtag('event', <action>, {
      'event_category': <category>,
      'event_label': <label>,
      'value': <value>
    });
    

    https://developers.google.com/analytics/devguides/collection/gtagjs/events