18F / analytics-reporter

Lightweight analytics reporting and publishing tool for Digital Analytics Program's Google Analytics 360 data.

Home Page:https://analytics.usa.gov/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

update reports.json to suit for GA4

scottqueen-bixal opened this issue · comments

Background

reports.json https://github.com/18F/analytics-reporter/blob/develop/reports/reports.json remains default report query config when running the analytics-reporter application.

User Story

  1. As a developer running reports using the analytics-reporter application, I want to find the example query schema that is passed to the Google Data API client requests when running the application locally as a developer in the report file reports.json.

This schema should follow the following structure:

...
    {
      "name": STRING,
      "frequency": STRING (one of realtime, daily, hourly,
      "realtime": BOOLEAN,
      "query": {
        "dimensions": [ OBJECT(S) ],
        "metrics":[ OBJECT(S) ],
        "dateRanges": [
          {
            "startDate": STRING,
            "endDate": STRING
          }
        ],
        "orderBys": [
          {
            "metric": {
              "metricName": STRING
            },
            "desc": BOOLEAN
          }
        ],
        "dimensionFilter": {
          "filter": {
            "fieldName": STRING,
            "stringFilter": {
              "value": STRING
            }
          }
        },
        "metricFilter": {
          "filter": {
            "fieldName": STRING,
            "numericFilter": {
              "operation":  STRING,
              "value": {
                "int64Value": STRING
              }
            }
          }
        }
      },
      "meta": {
        "name": STRING,
        "description": STRING
      }
    },
...

Acceptance Criteria

  • JSON file contains updated GA4 Query schema

reports.json is not used in our analytics applications to write to public s3 or database. It is however the default report schema that runs when ./bin/analytics is run.

You can review the schema changes here https://github.com/18F/analytics-reporter/pull/726/files#diff-22e3b4282a8acef83ca97ac25d3d6b82757fdd04fa0561973152a92645fec531