Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(customer-analytics): Default to accounts tab when CSP flag is on (#64360)

Arthur Moreira de Deusc251e86db290
diff --git a/frontend/src/products.tsx b/frontend/src/products.tsx
index 31e9b2470284..011bad44a051 100644
--- a/frontend/src/products.tsx
+++ b/frontend/src/products.tsx
@@ -2,6 +2,7 @@
// Generated by build-products.mjs – DO NOT EDIT BY HAND.
import { combineUrl } from 'kea-router'
+import posthog from 'posthog-js'
import { AlertType } from 'lib/components/Alerts/types'
import { FEATURE_FLAGS, INSIGHT_VISUAL_ORDER } from 'lib/constants'
@@ -419,8 +420,12 @@ export const productRedirects: Record<
'/llm-observability/playground': (_params, searchParams, hashParams) =>
combineUrl(urls.aiObservabilityPlayground(), searchParams, hashParams).url,
'/support': '/support/tickets',
- '/customer_analytics': (_params, searchParams, hashParams) =>
- combineUrl('/customer_analytics/dashboard', searchParams, hashParams).url,
+ '/customer_analytics': (_params, searchParams, hashParams) => {
+ const defaultTab = posthog.getFeatureFlag(FEATURE_FLAGS.CUSTOMER_ANALYTICS_CSP)
+ ? '/customer_analytics/accounts'
+ : '/customer_analytics/dashboard'
+ return combineUrl(defaultTab, searchParams, hashParams).url
+ },
'/data-warehouse/sources/:id': ({ id }) => urls.dataWarehouseSource(id, 'schemas'),
'/data-warehouse/sources/:id/:tab': ({ id, tab }) => urls.dataWarehouseSource(id, tab as SourceSceneTab),
'/error_tracking/configuration': (_params, searchParams, hashParams) => {
diff --git a/products/customer_analytics/manifest.tsx b/products/customer_analytics/manifest.tsx
index 425c22362f49..d0916cdb213a 100644
--- a/products/customer_analytics/manifest.tsx
+++ b/products/customer_analytics/manifest.tsx
@@ -1,4 +1,5 @@
import { combineUrl } from 'kea-router'
+import posthog from 'posthog-js'
import { FEATURE_FLAGS } from 'lib/constants'
import { urls } from 'scenes/urls'
@@ -43,8 +44,12 @@ export const manifest: ProductManifest = {
'/customer_analytics/configuration': ['CustomerAnalyticsConfiguration', 'customerAnalyticsConfiguration'],
},
redirects: {
- '/customer_analytics': (_params, searchParams, hashParams) =>
- combineUrl('/customer_analytics/dashboard', searchParams, hashParams).url,
+ '/customer_analytics': (_params, searchParams, hashParams) => {
+ const defaultTab = posthog.getFeatureFlag(FEATURE_FLAGS.CUSTOMER_ANALYTICS_CSP)
+ ? '/customer_analytics/accounts'
+ : '/customer_analytics/dashboard'
+ return combineUrl(defaultTab, searchParams, hashParams).url
+ },
},
urls: {
customerAnalytics: (): string => '/customer_analytics',