Search code examples
google-analyticsgoogle-analytics-apigoogle-analytics-firebase

Google Analytics API Custom Dimension name


I'm using the Reporting API v4 and collecting information about Custom Dimensions.

https://developers.google.com/analytics/devguides/reporting/core/dimsmets#view=detail&group=custom_variables_or_columns&jump=ga_dimensionxx

I am able to get dimensions like ga:dateHour but am unable to find a dimension that I can receive the "name". I want to pull in the names "zcode" and "ztest" described in this picture Custom Dimensions

Am I missing a dimension or metric in this API to achieve this?

Thanks!


Solution

  • The name is used in the reporting interface only. In the API you address custom dimensions by the keyword "dimension" followed by their respective numeric index.

    So in your example you would retrieve values for "zcode" by querying "dimension1".