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 api.json report

scottqueen-bixal opened this issue · comments

Background

api.json https://github.com/18F/analytics-reporter/blob/migrate-ga3-to-ga4/reports/api.json is the source query configuration for building data files that are written to the Postgress database that supports https://open.gsa.gov/api/dap/

User Story

  1. As a developer running reports using the analytics-reporter application, I want to find the query schema that is passed to the Google Data API client requests in the report file api.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

Query can be:

includes

  • /reports/<report name>/data

**detailed requests availability can be found at https://open.gsa.gov/api/dap/

Browser version is not available https://stackoverflow.com/a/68286131,   Mostly impacts ie, and windows-ie reports

We should consider removing these reports if ie version is no longer accessible

Image

Note: we are already not including in the updated MVP https://analytics-develop.app.cloud.gov/data/

hasSocialSourceReferral is not available Was a yes no value impacts traffic-source report

we have an option to relace with sessionDefaultChannelGroup, this provides the referral type

defaultChannelGroup Default channel group The conversion's default channel group is based primarily on source and medium. An enumeration which includes Direct, Organic Search, Paid Social, Organic Social, Email, Affiliates, Referral, Paid Search, Video, and Display.

report values look like this

Image

remove from the API

@smarina04 For testing our reports schema we can review several points of changes to integration.

Review changes to api.json
https://github.com/18F/analytics-reporter/pull/726/files#diff-3d01cc079add8f7082bf80461898810abd7e6d48aae4bf6b04c8f9ef9319ffb7

Try API requests for any report names listed in api.json at /reports/<report name>/data

ie.

v1.1
https://api.gsa.gov/analytics/dap/develop/v1.1/reports/language/data?api_key=DEMO_KEY1

v2
https://api.gsa.gov/analytics/dap/develop/v2/reports/language/data?api_key=DEMO_KEY1

If you find any issues or concerns that would impact the MVP work with these query update(s), please leave as comment in this ticket.