Skip to content

feat(analytics): gate analytics prompt behind PostHog feature flag#302

Merged
theFong merged 1 commit intomainfrom
feat/analytics-feature-flag
Mar 3, 2026
Merged

feat(analytics): gate analytics prompt behind PostHog feature flag#302
theFong merged 1 commit intomainfrom
feat/analytics-feature-flag

Conversation

@theFong
Copy link
Member

@theFong theFong commented Mar 3, 2026

Summary

  • Add IsAnalyticsFeatureEnabled() that checks the enable-cli-analytics PostHog feature flag
  • Gate the analytics opt-in prompt in login behind this feature flag
  • Analytics is disabled by default unless the flag is enabled for the user in PostHog

Test plan

  • Verify that with the feature flag disabled, users are not prompted about analytics during login
  • Verify that with the feature flag enabled, users see the opt-in prompt as before
  • Verify that errors from the feature flag check default to not prompting

@theFong theFong requested a review from a team as a code owner March 3, 2026 06:24
Use the `enable-cli-analytics` PostHog feature flag to control whether
users are prompted about analytics opt-in during login. Analytics is
disabled by default unless the flag is enabled for the user.
@theFong theFong force-pushed the feat/analytics-feature-flag branch from 87c3cbf to db38697 Compare March 3, 2026 16:40

_, analyticsAsked := analytics.IsAnalyticsEnabled()
if !analyticsAsked {
if !analyticsAsked && analytics.IsAnalyticsFeatureEnabled() {
Copy link
Contributor

Choose a reason for hiding this comment

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

would it make sense to put this IsAnalyticsFeatureEnabled check into IsAnalyticsEnabled?

@theFong theFong merged commit 0ff745e into main Mar 3, 2026
9 checks passed
@theFong theFong deleted the feat/analytics-feature-flag branch March 3, 2026 18:58
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.

2 participants