GSA / data.gov

Main repository for the data.gov service
https://data.gov
Other
607 stars 98 forks source link

Create GA4 Reports using API #4807

Closed tdlowden closed 4 weeks ago

tdlowden commented 2 months ago

User Story

In order to populate a metrics dashboard datagov team wants API query reports structured to feed into a UI.

Acceptance Criteria

Background

These queries are needed to populate the charts in the metrics UI and agency pages

Security Considerations (required)

At some point, the connection to the GA4 API may need to be added into the system diagram

Sketch

TBD by @robert-bryson

Reports

“Global site reports” These reports represent metrics across the site, and will not be filterable by organization.

My thought on these is that they would be at the top of the (or every) page, sort of “pinned” above the org-specific charts/viz.

Report: Total pageviews Description: Total pageviews to catalog.data.gov and data.gov in the last 30 days Format: Number Exploration Report - “Dashboard - Pageviews”

Report: Top search terms Description: Most used search terms in the last 30 days Format: Table with search terms and number of searches, and potentially a bar chart to represent volume Exploration report - “Dashboard - Search Terms”

Report: Device Breakdown Description: Breakdown of visits by device type in the last 30 days Format: Pie chart with % of visits from desktop, mobile, tablet Exploration Report - “Dashboard - Device Breakdown”

“Agency-specific reports” All below metrics will be filtered by a dropdown that defaults to “All Data.gov” data, and contains choices to display data for a given organization. Also, an option to download a larger set of data must be available (either for each report individually or as a single, collated downloadable file).

In theory, these would all sit below the global site reports at the top. The default /metric page, unfiltered for org, could show all these reports in aggregate.

Report: Total Current Datasets Description: Total datasets and/or collections discoverable on catalog.data.gov Format: Number Report - This is NOT from GA; it is data we have currently at https://catalog.data.gov/report/metrics-dashboard

Report: Total Current Harvest Sources Description: Total metadata harvest sources Format: Number Report - This is NOT from GA; it is data we have currently at https://catalog.data.gov/report/metrics-dashboard

Report: Most viewed dataset pages Description: Top 10 dataset pages by pageviews in the last 30 days Format: Table with dataset name, URL (possibly hyperlinked?), pageviews, and potentially a bar visualization to represent volume Filter: limit to dataset pages and not search pages or documentation on catalog Exploration Report - “Dashboard - Top Datasets” (will need to be filtered by datagov_organization when possible)

Report: Most downloaded files Description: Top 10 files by download count in the last 30 days Format: Table with file URL, downloads count, and potentially a bar visualization to represent volume Exploration Report - “Dashboard - File Downloads” (will need to be filtered by datagov_organization when possible)

Report: Most clicked outbound links Description: Top 10 external link clicks Format: Table with link URL, clicks count, and potentially a bar visualization to represent volume Exploration Report - “Dashboard - Outbound Links” (will need to be filtered by datagov_organization when possible)