3
votes

Google Analytics (particularly version 4, "GA4") has various predefined events, each with its own parameters. E.g. the purchase event has an items parameter, which contains data such as item_id and item_name for each purchased item. JS code on a website can send these events and pass the extra data, and I can actually see the data in the "Analysis hub" in the Google Analytics interface.

Is there a way to also fetch this extra data using the Google Analytics Data API? There is a way to retrieve some predefined dimensions and also "custom dimensions" (via customEvent:parameter_name), but e.g. purchase item data doesn't seem to be a part of that.

Do I have to define custom dimensions (e.g. a purchasedProductId) and send them in addition to the items parameter, if I want to access this data via API?

1
What have you tried ?DaImTo
@DaImTo I'm using the Python SDK and AlphaAnalyticsDataClient, where I tried to create a RunReportRequest with dimensions=[Dimension(name='item_id')] and various variations of that name (itemId, productItemId, customEvent:item_id, etc.), but I'm always getting google.api_core.exceptions.InvalidArgument: 400 Field ... is not a valid dimension. For a list of valid dimensions and metrics, see https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema.Jan Pöschko

1 Answers

1
votes

Jan,

Ecommerce reporting is not yet supported in the Google Analytics Data API. I will update this question once I have more information about the timeline of this feature implementation.

Thanks, Ilya

The Google Analytics Team