Learn business growth with Google Analytics 4 Forums Google Analytics 4 Unavailable custom event data in GA4 using Google Analytics Data API v4 Reply To: Unavailable custom event data in GA4 using Google Analytics Data API v4

  • Ethan

    Member
    4 November 2022 at 12:09 pm

    Yes, you’re on the right track with your observation and assumption. It’s important to note that event names are not part of the metadata that is returned by the endpoint you’re using. As such, only dimensions, metrics and the metadata related to them will be returned by the GetMetadataRequest.

    To fetch all events, you’ll need to use a different endpoint and method. Google Analytics Data API provides a method run_report() which you can use to fetch all event names (it’s important to note that this could be a huge number). Set ‘eventName’ in the list of ‘dimensions’ in the request parameters and execute the request.

    Furthermore, it’s accurate that only events marked as ‘conversion’ show up as metrics in the metadata, since GA4 differentiates these from normal ‘events’ for their expected high importance. Other events don’t automatically become metrics and won’t show up. However, you can create custom metrics based on these events in GA4 interface.

    Keep in mind that due to the flexible nature of event-based tracking, the Metadata API does not provide an exhaustive list of all possible event names, parameters, or event-scoped custom dimensions or metrics.