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.

chore(marketing-analytics): remove fully rolled-out ad source flags (#66588)

posthog[bot]654289fd591e
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index b5f13960fba4..4693c8e0984a 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -251,7 +251,6 @@ export const FEATURE_FLAGS = {
APPROVALS: 'approvals', // owner: @yasen-posthog #team-platform-features
AVERAGE_PAGE_VIEW_COLUMN: 'average-page-view-column', // owner: @jordanm-posthog #team-web-analytics
BACKFILL_WORKFLOWS_DESTINATION: 'backfill-workflows-destination', // owner: #team-batch-exports
- BING_ADS_SOURCE: 'bing-ads-source', // owner: @jabahamondes #team-web-analytics
CDP_ACTIVITY_LOG_NOTIFICATIONS: 'cdp-activity-log-notifications', // owner: #team-workflows-cdp
CDP_DWH_TABLE_SOURCE: 'cdp-dwh-table-source', // owner: #team-workflows-cdp
CDP_HOG_SOURCES: 'cdp-hog-sources', // owner #team-workflows-cdp
@@ -400,7 +399,6 @@ export const FEATURE_FLAGS = {
PHAI_PLAN_MODE: 'phai-plan-mode', // owner: #team-posthog-ai
PHAI_SANDBOX_MODE: 'phai-sandbox-mode', // owner: #team-posthog-ai
PHAI_TASKS: 'phai-tasks', // owner: #team-array
- PINTEREST_ADS_SOURCE: 'pinterest-ads-source', // owner: @jabahamondes #team-web-analytics
PIPELINE_STATUS_PAGE: 'pipeline-status-page', // owner: @clr182 #team-support
POSTHOG_AI_BILLING_DISPLAY: 'posthog-ai-billing-display', // owner: #team-posthog-ai
POSTHOG_AI_CHANGELOG: 'posthog-ai-changelog', // owner: #team-posthog-ai
@@ -462,7 +460,6 @@ export const FEATURE_FLAGS = {
SHOW_REPLAY_FILTERS_FEEDBACK_BUTTON: 'show-replay-filters-feedback-button', // owner: @ksvat #team-replay
SIGNUP_AA_TEST_4_WAY: 'signup-aa-test-4-way', // owner: @andehen #team-experiments multivariate=control,test-1,test-2,test-3
SLACK_DWH: 'slack-dwh', // owner: @MarconLP #team-warehouse-sources
- SNAPCHAT_ADS_SOURCE: 'snapchat-ads-source', // owner: @jabahamondes #team-web-analytics
SQL_EDITOR_VIM_MODE: 'sql-editor-vim-mode', // owner: @arthurdedeus
SSE_DASHBOARDS: 'sse-dashboards', // owner: @aspicer #team-analytics-platform
SUBSCRIPTION_AI_PROMPT: 'ai-subscriptions', // owner: #team-analytics-platform, gates AI prompt-based subscriptions
diff --git a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/utils.test.ts b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/utils.test.ts
index 53f1dbef5c04..111dff3931d6 100644
--- a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/utils.test.ts
+++ b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/utils.test.ts
@@ -1,5 +1,3 @@
-import { FEATURE_FLAGS } from 'lib/constants'
-
import {
DatabaseSchemaDataWarehouseTable,
MARKETING_INTEGRATION_CONFIGS,
@@ -24,49 +22,9 @@ import {
describe('marketing analytics utils', () => {
describe('getEnabledNativeMarketingSources', () => {
- it.each([
- ['filters out BingAds when flag is disabled', { [FEATURE_FLAGS.BING_ADS_SOURCE]: false }, 'BingAds', false],
- ['includes BingAds when flag is enabled', { [FEATURE_FLAGS.BING_ADS_SOURCE]: true }, 'BingAds', true],
- ['filters out BingAds with empty feature flags', {}, 'BingAds', false],
- [
- 'filters out SnapchatAds when flag is disabled',
- { [FEATURE_FLAGS.SNAPCHAT_ADS_SOURCE]: false },
- 'SnapchatAds',
- false,
- ],
- [
- 'includes SnapchatAds when flag is enabled',
- { [FEATURE_FLAGS.SNAPCHAT_ADS_SOURCE]: true },
- 'SnapchatAds',
- true,
- ],
- ['filters out SnapchatAds with empty feature flags', {}, 'SnapchatAds', false],
- [
- 'filters out PinterestAds when flag is disabled',
- { [FEATURE_FLAGS.PINTEREST_ADS_SOURCE]: false },
- 'PinterestAds',
- false,
- ],
- [
- 'includes PinterestAds when flag is enabled',
- { [FEATURE_FLAGS.PINTEREST_ADS_SOURCE]: true },
- 'PinterestAds',
- true,
- ],
- ['filters out PinterestAds with empty feature flags', {}, 'PinterestAds', false],
- ])('%s', (_name, featureFlags, source, shouldInclude) => {
- const result = getEnabledNativeMarketingSources(featureFlags ?? {})
- expect(result.includes(source as any)).toBe(shouldInclude)
- })
-
- it('always includes sources without feature flag requirements', () => {
- const sourcesWithoutFlags = VALID_NATIVE_MARKETING_SOURCES.filter(
- (s) => s !== 'BingAds' && s !== 'SnapchatAds' && s !== 'PinterestAds'
- )
+ it('returns every native source when no source is flag-gated', () => {
const result = getEnabledNativeMarketingSources({})
- sourcesWithoutFlags.forEach((source) => {
- expect(result).toContain(source)
- })
+ expect([...result]).toEqual([...VALID_NATIVE_MARKETING_SOURCES])
})
})
diff --git a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/utils.ts b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/utils.ts
index 47dd8daf910b..a52c6b7d9c96 100644
--- a/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/utils.ts
+++ b/frontend/src/scenes/web-analytics/tabs/marketing-analytics/frontend/logic/utils.ts
@@ -1,4 +1,4 @@
-import { FEATURE_FLAGS, type FeatureFlagKey } from 'lib/constants'
+import type { FeatureFlagKey } from 'lib/constants'
import {
AttributionMode,
@@ -28,12 +28,10 @@ export const VALID_SELF_MANAGED_MARKETING_SOURCES: ManualLinkSourceType[] = [
'azure',
]
-// Map of native sources that require feature flags to be enabled
-export const NATIVE_SOURCE_FEATURE_FLAGS: Partial<Record<NativeMarketingSource, FeatureFlagKey>> = {
- BingAds: FEATURE_FLAGS.BING_ADS_SOURCE,
- SnapchatAds: FEATURE_FLAGS.SNAPCHAT_ADS_SOURCE,
- PinterestAds: FEATURE_FLAGS.PINTEREST_ADS_SOURCE,
-}
+// Map of native sources that require a feature flag to be enabled. Empty today
+// (all current sources are fully rolled out), but kept so a new source can be
+// gated behind a flag while it's being rolled out.
+export const NATIVE_SOURCE_FEATURE_FLAGS: Partial<Record<NativeMarketingSource, FeatureFlagKey>> = {}
/**
* Filter native marketing sources based on feature flags