Skip to content

Audit custom dimension registration and data retention settings across all DPLA GA4 properties #303

Description

@DominicBM

Background

The DPLA Analytics Dashboard queries GA4 via the Data API (runReport), which draws from pre-aggregated reporting tables rather than raw event-level data. Standard metrics (sessions, users, event counts) are retained indefinitely in these tables regardless of the event data retention setting.

However, custom event parameters — specifically customEvent:event_category, the field that carries hub attribution (e.g. "View Item : Digital Commonwealth") — may behave differently. For a custom event parameter to be included in GA4's aggregated reporting tables (and therefore queryable via runReport indefinitely), it must be registered as a custom dimension in the GA4 property. If it is not registered, queries against it may silently return no data once the event-level retention window passes.

Since hub-attributed events only started flowing correctly in May 2025, all existing hub-attribution data is recent enough to fall within any retention window — we cannot detect a registration gap from query results alone.

Properties to Audit

All of the following are DPLA-managed GA4 properties under the same account:

Site Measurement ID
dp.la (main) G-1P5QWL64H0 (property 369185054)
florida.dp.la G-6PYKFL6JZF
illinois.dp.la G-9ZE47RTKH5
nwdh.dp.la G-64QXSW0Q5K
plains2peaks.dp.la G-PZK6XWKZDN
wisconsin.dp.la G-6FP9Q9EVYZ

The five local sites with empty GA_TRACKING_ID (aviation, njde, oklahoma, texas, vermont) do not yet have GA4 properties configured — they are covered by issue #299.

Checks to Perform on Each Property

1. Custom dimension registration

In GA4 Admin → Custom definitions → Custom dimensions:

Verify that event_category is registered as an event-scoped custom dimension. If it is absent, register it:

  • Dimension name: Event Category (or similar)
  • Scope: Event
  • Event parameter: event_category

Without this registration, customEvent:event_category queries via the Data API may stop returning data once event-level retention expires, silently breaking hub and contributor attribution across every section of the dashboard.

Also check for any other custom event parameters the dashboard queries (review GA4_DIMENSIONS in app/lib/ga_response_builder.rb for the full list).

2. Event data retention setting

In GA4 Admin → Data Settings → Data Retention:

Set Event data retention to 14 months (the maximum on the free GA4 tier) on every property. This does not affect runReport for aggregated data, but it does affect Explorations, User Explorer, and any future BigQuery export raw tables. Set Reset user data on new activity per preference — this does not affect event parameter retention.

This setting change is not retroactive; data already purged cannot be recovered.

3. Programmatic access (future)

Currently the analyticsadmin.googleapis.com API is disabled in GCP project analytics-dashboard-491003, preventing the service account from querying Admin API endpoints programmatically. Enabling this API would allow automated auditing and alerting of retention settings going forward. Consider enabling it alongside the BigQuery work tracked in #285.

Notes

  • The local site properties (Florida, Illinois, NWDH, Plains to Peaks, Wisconsin) currently send events to their own GA4 properties only, not to the main DPLA property. Until issue Local sites produce no analytics data in the dashboard — investigate and add coverage #299 is resolved (dual-stream tracking), only the main property's custom dimension registration affects the dashboard directly. However, registering custom dimensions in all properties now is still correct hygiene for any future reporting done against those properties.
  • Do not confuse the event data retention setting with reporting data longevity. Data visible in runReport going back to April 2023 is from aggregated reporting tables and is not subject to the 2/14-month slider.

/cc @megannp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions