简体   繁体   中英

Retrieve customparams data from GA4 api

Is there a way to retrieve customevents params from GA4 Data API ?

Everytime I tried and run it as shown in google's API doc it returns me this error:

 details = "Field customEvent:parameter_name 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 "

It may depend on when the parameter was created and the name you are using to call it.

From documentation:

The Data API can create reports on Event and User scoped Custom Dimensions. See Event-scoped custom dimensions and metrics reporting and Custom user properties to learn more about custom dimensions. Custom dimensions are specified in an API report request by the dimension's parameter name and scope. For example, include " customEvent:achievement_id " in a Data API request to create a report for the Event-scoped Custom Dimension with parameter name " achievement_id ". This API request will fail if the property has not registered this Event-scoped Custom Dimension.

If an Event-scoped Custom Dimension was registered before October 2020 , the dimension must be specified in an API request with its event name. For example, include "customEvent:achievement_id[level_up]" for the Event-scoped Custom Dimension with parameter name "achievement_id" and event name "level_up". In October 2020, Analytics replaced Custom-parameter reporting with Event-scoped custom dimensions and metrics reporting.

https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM