-
Unavailable custom event data in GA4 using Google Analytics Data API v4
Hey everyone! So we’re trying to set up our website with GA4 to collect data using Google Analytics Data API v4. We were able to set up custom events which show up smoothly on Google Analytics UI under Engagement/Events. However, when we access https://analyticsdata.googleapis.com/v1beta/, it seems like some are playing hide and seek.
Just to give you clearer picture, we used this code to fetch a list of all dimensions and metrics:
from google.analytics.data_v1beta import BetaAnalyticsDataClient from google.analytics.data_v1beta.types import GetMetadataRequest property_id = "PROPERTY_ID" client = BetaAnalyticsDataClient() request = GetMetadataRequest(name=f"properties/{property_id}/metadata") print(client.get_metadata(request=request))
It’s quite perplexing that some events aren’t visible through the code above. Has anyone else encountered a similar situation?
Thanks a bunch!
PS: I discovered that only events marked as conversion (Configure/Events) turn up in the metadata. Interesting, isn’t it?
PPS: Based on this, the link
https://analyticsdata.googleapis.com/v1beta/properties/GA4_PROPERTY_ID/metadata
gives back only metrics and dimensions. I’m guessing that we might require something a bit different to retrieve all events? Thoughts?
Log in to reply.