google-analytics - Google Analytics Collector

The google-analytics collector queries a view in google analytics. The configuration uses dimensions and metrics with the same name and meaning in the google analytics API.

Account-level properties

  • credentials (string or object):
  • If the value is a string then it is treated as a file-path assumed to be a JSON file which corresponds to a Google Service Account Credentials file.
  • If the value is an object then it is assumed to be the inlined JSON content of the Google Service Account Credentials file.

Query-level properties

  • view_id
  • time_grain - day or hour - specifies the level of time-granularity to aggregate the query results. ( In GA terms this means the batchGet query will use either the ga:date or ga:dateHour as a timestamp for the results ).
  • dimensionFilterClauses, filtersExpression, metricFilterClauses - these expressions are used to filter the query results from GA, they are injected as-is into the generated query to batchGet.

The query dimensions and metrics are taken from the dimension_defs and metric_defs properties.

  • dimension_defs - the dimension names are identical to those in google analytics API.
  • It is discouraged to use absolute temporal dimensions in dimension_defs such as ga:date and ga:dateHour as a dimension as this may result in distinct metrics for each timestamp in the Anodot UI. The collector will automatically request the correct temporal dimension based on the time_grain attribute and use it as a timestamp but not as a dimension.