-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Analytics: add OAuth authentication and guest access events #9541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Connected to Huly®: UBERF-12491 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR instruments analytics around OAuth flows and guest access, enriching event data and distinguishing guest versus regular user interactions.
- Extended
AnalyticProvider
interface and implementations to include aguest
flag insetWorkspace
. - Added new
LoginEvents
for OAuth start, completion, and errors; wired them into Svelte components and utility functions. - Enhanced guest connect logic to send detailed event payloads (
social_id
, workspace URLs, UUIDs) and track guest visits.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
plugins/workbench-resources/src/connect.ts | Added guestRole flag to workspace analytics calls and restructured event payloads. |
plugins/login-resources/src/utils.ts | Instrumented guest login/start/completion/error and workspace selection events; implemented trackOAuthCompletion . |
plugins/login-resources/src/components/Providers.svelte | Added click handler to track OAuth provider start events before navigation. |
plugins/login-resources/src/components/Auth.svelte | Detected OAuth provider from URL/referrer and tracked login/signup completion or error events. |
plugins/login-resources/src/analytics.ts | Defined new dot-separated event names for OAuth and guest flows in LoginEvents . |
plugins/guest-resources/src/connect.ts | Replaced literal guest login event, enriched payload, set guest workspace flag in analytics calls. |
packages/analytics/src/index.ts | Updated AnalyticProvider.setWorkspace signature to include a guest boolean. |
packages/analytics-service/src/sentry.ts | Updated Sentry provider to tag either workspace or visited-workspace based on guest flag. |
packages/analytics-providers/src/sentry.ts | Same update for Sentry under analytics-providers . |
packages/analytics-providers/src/posthog.ts | Adapted Posthog provider to only group non-guest workspaces and tag appropriately. |
packages/analytics-providers/src/analyticsCollector.ts | Extended analytics collector provider to emit $group_type and tag key based on guest flag. |
dev/prod/.env | Updated ANALYTICS_COLLECTOR_URL for production environment. |
Comments suppressed due to low confidence (1)
plugins/guest-resources/src/connect.ts:200
- [nitpick] The event name
'GUEST LOGIN'
is a literal and doesn't follow the dot-separated naming convention (e.g., 'login.guest.started'). Consider adding a constant in your analytics events or using a consistent pattern for clarity and maintainability.
Analytics.handleEvent('GUEST LOGIN', data)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lexiv0re Please check socialId stuff.
1193c60
to
6847181
Compare
Signed-off-by: Alexander Platov <[email protected]>
Signed-off-by: Alexander Platov <[email protected]>
Signed-off-by: Alexander Platov <[email protected]>
Signed-off-by: Alexander Platov <[email protected]>
9039164
to
28c104a
Compare
Signed-off-by: Alexander Platov <[email protected]>
Added analytics events for tracking:
Changes: