Skip to content

Flag suspect direct sessions and log edge diagnostics - #1399

Merged
tannerlinsley merged 1 commit into
mainfrom
taren/traffic-quality
Oct 19, 2026
Merged

tannerlinsley merged 1 commit into
mainfrom
taren/traffic-quality

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Adds flag-only GA4 traffic quality labels for the first-session, Direct, reduced-version Chrome fingerprint. Windows/Linux are labeled automated and macOS suspect; nothing is blocked or excluded from reporting.

The head bootstrap uses GA's supported session getters, preserves the classification across navigation against the GA session identity, and releases events as unknown if lookup fails. Automatic events remain unknown to avoid applying a stale first-session label to a later session. Reports must group labels by GA session. Chrome baseline is configurable (155, gap 7).

Adds same-origin Worker diagnostics for flagged documents with ASN/network owner and available automation signals, without raw IPs or GA identifiers. Includes rollout notes and a BigQuery query for investigating sessions without page views. Historical findings and GA custom-dimension registration remain unverified because the connected analytics tool has no credentials.

Validation: classifier, session continuity/returning-session, timeout, edge input/privacy tests; minified inline bootstrap execution; full pnpm test.

Summary by CodeRabbit

  • New Features
    • Analytics events now include traffic-quality labels, including automated, suspect, unflagged, or unknown classifications.
    • Limited diagnostic data may be sent for identified automated or suspect sessions. Diagnostics are skipped when Do Not Track or Global Privacy Control is enabled.
    • Page-view behavior remains unchanged.
  • Documentation
    • Added guidance on traffic-quality labels, diagnostic data handling, and a seven-day review process.

@tannerlinsley
tannerlinsley requested a review from a team October 19, 2026 18:03
@changeset-bot

changeset-bot Bot commented Oct 19, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: eed05c4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@tannerlinsley
tannerlinsley merged commit 924c15d into main Oct 19, 2026
7 checks passed
@tannerlinsley
tannerlinsley deleted the taren/traffic-quality branch October 19, 2026 18:09
@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d945f009-28a9-4ceb-9ea5-2bc1de2c4c2d
📥 Commits

Reviewing files that changed from the base of the PR and between cfe8215 and eed05c4.

📒 Files selected for processing: 7
  • docs/analytics/missing-page-views.sql
  • docs/analytics/traffic-quality.md
  • src/routes/__root.tsx
  • src/server.ts
  • src/utils/analytics/traffic-quality.server.ts
  • src/utils/analytics/traffic-quality.ts
  • tests/traffic-quality.test.ts
+-------------------------------+
| This hotfix needs oven mitts. |
+-------------------------------+
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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