Skip to content

fix: prevent template DAU undercount from session telemetry gaps - #5530

Merged
steve8708 merged 1 commit into
mainfrom
fix/analytics-dau-sep15
Sep 21, 2026
Merged

steve8708 merged 1 commit into
mainfrom
fix/analytics-dau-sep15

Conversation

@steve8708

Copy link
Copy Markdown
Contributor

Summary

  • Count signed-in activity from legacy and canonical session-status events plus identified app-entry telemetry.
  • Repair the persisted BigQuery template DAU query and keep the catalog/seed definitions aligned.
  • Add regression coverage for event aliases, fallback activity, and BigQuery dashboard repair.

Root cause

The template DAU panels treated session status as the only signed-in activity signal. From Sep 15 through Sep 19, identified app-entry activity continued while session-status rows fell, so every template was undercounted. The BigQuery panel also did not recognize the canonical session_status alias introduced later. This fix is scoped to the Sep 15+ decline; the known Sep 2-6 zero window is not changed.

Validation

  • Analytics focused tests: 111 passed
  • Analytics typecheck: source checks clean; local production-config warnings remain for missing deployment secrets/database
  • Repository guards: 77 passed

Deployment remains subject to the normal post-merge prebuilt publisher boundary.

steve8708 added a commit that referenced this pull request Sep 21, 2026
{"pr":5530,"owner_thread":"01a0c45d-ff61-7163-a15d-73b147fae4b6","owner":"codex","version":2,"expires_at":"2026-09-21T16:29:00Z","observed_legacy_version":"none","legacy_retired":true,"status":"active"}
steve8708 added a commit that referenced this pull request Sep 21, 2026
{"pr":5530,"owner_thread":"01a0c45d-ff61-7163-a15d-73b147fae4b6","owner":"codex","version":3,"expires_at":"2026-09-21T16:30:52Z","observed_legacy_version":"none","legacy_retired":true,"status":"active"}
steve8708 added a commit that referenced this pull request Sep 21, 2026
{"pr":5530,"owner_thread":"01a0c45d-ff61-7163-a15d-73b147fae4b6","owner":"codex","version":3,"expires_at":"2026-09-21T16:30:59Z","observed_legacy_version":"none","legacy_retired":true,"status":"active"}
@github-actions

github-actions Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Here's a visual recap of what changed:

Visual recap

Open the full interactive recap

steve8708 added a commit that referenced this pull request Sep 21, 2026
{"pr":5530,"owner_thread":"01a0c45d-ff61-7163-a15d-73b147fae4b6","owner":"codex","version":4,"expires_at":"2026-09-21T16:32:18Z","observed_legacy_version":"none","legacy_retired":true,"status":"active"}

@builder-io-integration builder-io-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builder reviewed your changes — looks good ✅

Review Details

Code Review Summary

This PR fixes an analytics DAU undercount by expanding signed-in activity detection to include fallback event signals.

What Changed

The PR updates template analytics queries across 8 metrics (DAU, WAU, retention, recurring users) to count signed-in activity from:

  1. Both session_status and session_status event name variants (handling telemetry aliases)
  2. app_entered events with identified users as a fallback when session telemetry gaps occur

Core filter updated from event-based to OR-based logic:

  • Before: event_name = 'session status' AND signed_in = 'true'
  • After: ((event_name IN ('session status', 'session_status') AND signed_in = 'true') OR (event_name = 'app_entered' AND identified user)) AND user_key IS NOT NULL

What I Verified

Filter Logic — Both PostgreSQL and BigQuery implementations correctly handle OR conditions with proper parenthesization. User key deduplication prevents double-counting across event types. ✓

Backward Compatibility — Legacy SQL constants preserve old behavior. Repair functions safely migrate stale BigQuery queries to new format using two-step replacement (full pattern → partial pattern). ✓

Data Consistency — All 8 affected panels have matching filters in the metric catalog, seed dashboard, and test expectations. Descriptions updated to reflect fallback behavior. ✓

Event ClassificationisMarketingWebsiteSessionEvent() now accepts both event name variants. User identification checks properly validate required fields per event type. ✓

Test Coverage — Regression tests validate event aliases, fallback activity, and metric catalog/seed synchronization. All 111 tests passing. ✓

Risk: Standard — This is a scoped business logic fix to analytics query generation with no authentication, payment, or destructive changes involved. Backend-only change with no UI impact.

🧪 Browser testing: Skipped — PR only modifies backend analytics templates and tests, no UI code touched

steve8708 added a commit that referenced this pull request Sep 21, 2026
{"pr":5530,"owner_thread":"01a0c45d-ff61-7163-a15d-73b147fae4b6","owner":"codex","version":5,"expires_at":"2026-09-21T16:40:04Z","observed_legacy_version":"none","legacy_retired":true,"status":"active"}
steve8708 added a commit that referenced this pull request Sep 21, 2026
{"pr":5530,"owner_thread":"01a0c45d-ff61-7163-a15d-73b147fae4b6","owner":"codex","version":6,"expires_at":"2026-09-21T16:49:49Z","observed_legacy_version":"none","legacy_retired":true,"status":"active"}
steve8708 added a commit that referenced this pull request Sep 21, 2026
{"pr":5530,"owner_thread":"01a0c45d-ff61-7163-a15d-73b147fae4b6","owner":"codex","version":7,"expires_at":"2026-09-21T16:59:39Z","observed_legacy_version":"none","legacy_retired":true,"status":"active"}
@steve8708
steve8708 merged commit adec853 into main Sep 21, 2026
68 of 71 checks passed
@steve8708
steve8708 deleted the fix/analytics-dau-sep15 branch September 21, 2026 16:39
steve8708 added a commit that referenced this pull request Sep 21, 2026
{"pr":5530,"owner_thread":"01a0c45d-ff61-7163-a15d-73b147fae4b6","owner":"codex","version":8,"expires_at":"2026-09-21T16:40:33Z","observed_legacy_version":"none","legacy_retired":true,"status":"released","released":true}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant