Search code examples
google-analyticsgoogle-analytics-api

Google Analytics Real Time Reporting API - Universe of metric data types


I am using the Google Analytics Real Time Reporting API and writing a function to map the string columnHeaders.dataType to a Type. The documentation states the following:

Data type. Dimension column headers have only STRING as the data type. Metric column headers have data types for metric values such as INTEGER, DOUBLE, CURRENCY etc.

I'm wondering if anyone can document a definitive definition of the etc for completeness.


Solution

  • Google Analytics Metadata API returns all the Dimension and Metrics with their attributes in JSON format.

    Checkout Live Metadata API response, in which you will be able to find all the data types.

    List of data types for Dimensions:

    • STRING

    List of data types for Metrics:

    • INTEGER
    • PERCENT
    • TIME
    • CURRENCY
    • FLOAT