1

I would like to retrieve data from Google Analytics Data API. Endpoint is:

https://analyticsdata.googleapis.com/v1beta/properties/{property_id}:runReport

I would like to get report of number of events per event_name and username (from user_properties), what is the metric and dimension that I should use?

I tried initially dimension:user_id but I got 'Field user_id is not a valid dimension'.

Thank you!

elaamrani
  • 31
  • 4

1 Answers1

0

To query that data using the runReport method, you'll need to register "username" as a User-scoped custom dimension. There's documentation on that in Custom dimensions and metrics.

However, it's not recommended to register a high-cardinality dimension like a "username" as a custom definition; here are some best practice alternatives to consider: Best practices for User-ID.

Brett
  • 1,189
  • 4
  • 12