Skip to content

Commit

Permalink
feat(web-analytics): Display data relevant to currently selected conv…
Browse files Browse the repository at this point in the history
…ersion goal (#26586)
  • Loading branch information
rafaeelaudibert authored Dec 11, 2024
1 parent ef77527 commit d726d02
Show file tree
Hide file tree
Showing 11 changed files with 567 additions and 326 deletions.
1 change: 1 addition & 0 deletions frontend/src/lib/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ export const FEATURE_FLAGS = {
BILLING_SKIP_FORECASTING: 'billing-skip-forecasting', // owner: @zach
EXPERIMENT_STATS_V2: 'experiment-stats-v2', // owner: @danielbachhuber #team-experiments
WEB_ANALYTICS_PERIOD_COMPARISON: 'web-analytics-period-comparison', // owner: @rafaeelaudibert #team-web-analytics
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
11 changes: 11 additions & 0 deletions frontend/src/queries/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -12697,6 +12697,17 @@
"$ref": "#/definitions/CompareFilter",
"description": "Compare to date range"
},
"conversionGoal": {
"anyOf": [
{
"$ref": "#/definitions/WebAnalyticsConversionGoal"
},
{
"type": "null"
}
],
"description": "Whether we should be comparing against a specific conversion goal"
},
"dateRange": {
"$ref": "#/definitions/InsightDateRange",
"description": "Date range for the query"
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/queries/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,8 @@ export interface TrendsQuery extends InsightsQueryBase<TrendsQueryResponse> {
breakdownFilter?: BreakdownFilter
/** Compare to date range */
compareFilter?: CompareFilter
/** Whether we should be comparing against a specific conversion goal */
conversionGoal?: WebAnalyticsConversionGoal | null
}

export type AssistantArrayPropertyFilterOperator = PropertyOperator.Exact | PropertyOperator.IsNot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export function WebAnalyticsRecordingsTile({ tile }: { tile: ReplayTile }): JSX.
const { layout } = tile
const { replayFilters, webAnalyticsFilters } = useValues(webAnalyticsLogic)
const { currentTeam } = useValues(teamLogic)

const sessionRecordingsListLogicInstance = sessionRecordingsPlaylistLogic({
logicKey: 'webAnalytics',
filters: replayFilters,
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/scenes/web-analytics/tiles/WebAnalyticsTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,11 @@ export const webAnalyticsDataTableQueryContext: QueryContext = {
render: VariationCell(),
align: 'right',
},
unique_conversions: {
title: <span className="pr-5">Unique Conversions</span>,
render: VariationCell(),
align: 'right',
},
conversion_rate: {
title: <span className="pr-5">Conversion Rate</span>,
render: VariationCell({ isPercentage: true }),
Expand Down
199 changes: 127 additions & 72 deletions frontend/src/scenes/web-analytics/webAnalyticsLogic.tsx

Large diffs are not rendered by default.

Loading

0 comments on commit d726d02

Please sign in to comment.