Skip to content

Commit

Permalink
Protect conversion goal behind feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaeelaudibert committed Dec 5, 2024
1 parent 0458f54 commit bb88cec
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
1 change: 1 addition & 0 deletions frontend/src/lib/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ export const FEATURE_FLAGS = {
SITE_APP_FUNCTIONS: 'site-app-functions', // owner: @mariusandra #team-cdp
REPLAY_HOGQL_FILTERS: 'replay-hogql-filters', // owner: @pauldambra #team-replay
REPLAY_LIST_RECORDINGS_AS_QUERY: 'replay-list-recordings-as-query', // owner: @pauldambra #team-replay
WEB_ANALYTICS_CONVERSION_GOAL_FILTERS: 'web-analytics-conversion-goal-filters', // owner: @rafaeelaudibert #team-web-analytics
} as const
export type FeatureFlagKey = (typeof FEATURE_FLAGS)[keyof typeof FEATURE_FLAGS]

Expand Down
27 changes: 20 additions & 7 deletions frontend/src/scenes/web-analytics/webAnalyticsLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,9 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([
compare,
},
filterTestAccounts,
conversionGoal,
conversionGoal: featureFlags[FEATURE_FLAGS.WEB_ANALYTICS_CONVERSION_GOAL_FILTERS]
? conversionGoal
: undefined,
properties: webAnalyticsFilters,
},
hidePersonsModal: true,
Expand Down Expand Up @@ -649,7 +651,9 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([
sampling,
limit: 10,
filterTestAccounts,
conversionGoal,
conversionGoal: featureFlags[FEATURE_FLAGS.WEB_ANALYTICS_CONVERSION_GOAL_FILTERS]
? conversionGoal
: undefined,
...(source || {}),
},
embedded: false,
Expand Down Expand Up @@ -850,7 +854,11 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([
sampling,
limit: 10,
filterTestAccounts,
conversionGoal,
conversionGoal: featureFlags[
FEATURE_FLAGS.WEB_ANALYTICS_CONVERSION_GOAL_FILTERS
]
? conversionGoal
: undefined,
stripQueryParams: shouldStripQueryParams,
},
embedded: false,
Expand Down Expand Up @@ -1125,7 +1133,11 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([
trendsFilter: {
display: ChartDisplayType.WorldMap,
},
conversionGoal,
conversionGoal: featureFlags[
FEATURE_FLAGS.WEB_ANALYTICS_CONVERSION_GOAL_FILTERS
]
? conversionGoal
: undefined,
filterTestAccounts,
properties: webAnalyticsFilters,
},
Expand Down Expand Up @@ -1426,15 +1438,16 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([
},
],
replayFilters: [
(s) => [s.webAnalyticsFilters, s.dateFilter, s.shouldFilterTestAccounts, s.conversionGoal],
(s) => [s.webAnalyticsFilters, s.dateFilter, s.shouldFilterTestAccounts, s.conversionGoal, s.featureFlags],
(
webAnalyticsFilters: WebAnalyticsPropertyFilters,
dateFilter,
shouldFilterTestAccounts,
conversionGoal
conversionGoal,
featureFlags
): RecordingUniversalFilters => {
const filters: UniversalFiltersGroupValue[] = [...webAnalyticsFilters]
if (conversionGoal) {
if (conversionGoal && featureFlags[FEATURE_FLAGS.WEB_ANALYTICS_CONVERSION_GOAL_FILTERS]) {
if ('actionId' in conversionGoal) {
filters.push({
id: conversionGoal.actionId,
Expand Down

0 comments on commit bb88cec

Please sign in to comment.