Skip to content

Identify signed-in visitors on pages outside a workspace - #391

Merged
tnkuehne merged 1 commit into
mainfrom
identify-signed-in-pages
Nov 25, 2026
Merged

tnkuehne merged 1 commit into
mainfrom
identify-signed-in-pages

Conversation

@tnkuehne

@tnkuehne tnkuehne commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The browser linked its anonymous visit to the account only on workspace pages (updateClientContext returned before identify without an organization). A person who signed in and stopped on a signed-in page outside a workspace, such as the organization chooser (/organizations) or the CLI approval page (/device), was never identified. Their visit stayed a separate anonymous person, so product analytics counted one signed-in person twice and could not attribute the visit to the account.

Change

  • The root layout load returns the signed-in user (id, name, email) when analytics is configured.
  • The root layout passes that user to updateClientContext, so every signed-in page calls identify.
  • updateClientContext identifies as soon as a user is known and adds the organization group and role only when an organization is present. Workspace pages behave as before.

Email-code sign-in navigates with invalidateAll, so the root layout load reruns and the first signed-in page already identifies. Social and company sign-in return through a full page load. Sign-out still resets the client before the next anonymous page.

Verification

  • pnpm check
  • tests/analytics-client.test.ts covers identification without an organization, without a group or role registration.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Links signed-in visits to an account before the user enters a workspace.

  • Signed-in pages identify people before they choose a workspace.

No actionable issues found. Tests were not run during this review.

Reviews (1) · Last reviewed commit: "Identify signed-in visitors on pages out..." · Reviewed by Greptile

The browser linked its anonymous visit to the account only on workspace
pages. A person who signed in and stopped on the organization chooser or
the CLI approval page stayed a separate anonymous person in product
analytics.

The root layout now passes the signed-in user, so every signed-in page
identifies the person. Workspace pages still add the organization group
and role.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
widefleet-docs 6f3778a Nov 25 2026, 01:12 PM

@tnkuehne
tnkuehne merged commit 4e05604 into main Nov 25, 2026
16 of 17 checks passed
@tnkuehne
tnkuehne deleted the identify-signed-in-pages branch November 25, 2026 13:23
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