Skip to content

Commit

Permalink
Stop displaying unrelated-to-conversion-goal sections
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaeelaudibert committed Dec 3, 2024
1 parent 46e1a10 commit dfd15b5
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 59 deletions.
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
119 changes: 60 additions & 59 deletions frontend/src/scenes/web-analytics/webAnalyticsLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1169,62 +1169,64 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([
],
}
: null,
{
kind: 'query',
tileId: TileId.RETENTION,
title: 'Retention',
layout: {
colSpanClassName: 'md:col-span-2',
},
query: {
kind: NodeKind.InsightVizNode,
source: {
kind: NodeKind.RetentionQuery,
properties: webAnalyticsFilters,
dateRange,
filterTestAccounts,
retentionFilter: {
retentionType: RETENTION_FIRST_TIME,
retentionReference: 'total',
totalIntervals: isGreaterThanMd ? 8 : 5,
period: RetentionPeriod.Week,
},
},
vizSpecificOptions: {
[InsightType.RETENTION]: {
hideLineGraph: true,
hideSizeColumn: !isGreaterThanMd,
useSmallLayout: !isGreaterThanMd,
},
},
embedded: true,
},
insightProps: createInsightProps(TileId.RETENTION),
canOpenInsight: false,
canOpenModal: true,
docs: {
url: 'https://posthog.com/docs/web-analytics/dashboard#retention',
title: 'Retention',
description: (
<>
<div>
<p>
Retention creates a cohort of unique users who performed any event for the
first time in the last week. It then tracks the percentage of users who
return to perform any event in the following weeks.
</p>
<p>
You want the numbers numbers to be the highest possible, suggesting that
people that come to your page continue coming to your page - and performing
an actions. Also, the further down the table the higher the numbers should
be (or at least as high), which would indicate that you're either increasing
or keeping your retention at the same level.
</p>
</div>
</>
),
},
},
!conversionGoal
? {
kind: 'query',
tileId: TileId.RETENTION,
title: 'Retention',
layout: {
colSpanClassName: 'md:col-span-2',
},
query: {
kind: NodeKind.InsightVizNode,
source: {
kind: NodeKind.RetentionQuery,
properties: webAnalyticsFilters,
dateRange,
filterTestAccounts,
retentionFilter: {
retentionType: RETENTION_FIRST_TIME,
retentionReference: 'total',
totalIntervals: isGreaterThanMd ? 8 : 5,
period: RetentionPeriod.Week,
},
},
vizSpecificOptions: {
[InsightType.RETENTION]: {
hideLineGraph: true,
hideSizeColumn: !isGreaterThanMd,
useSmallLayout: !isGreaterThanMd,
},
},
embedded: true,
},
insightProps: createInsightProps(TileId.RETENTION),
canOpenInsight: false,
canOpenModal: true,
docs: {
url: 'https://posthog.com/docs/web-analytics/dashboard#retention',
title: 'Retention',
description: (
<>
<div>
<p>
Retention creates a cohort of unique users who performed any event for
the first time in the last week. It then tracks the percentage of
users who return to perform any event in the following weeks.
</p>
<p>
You want the numbers numbers to be the highest possible, suggesting
that people that come to your page continue coming to your page - and
performing an actions. Also, the further down the table the higher the
numbers should be (or at least as high), which would indicate that
you're either increasing or keeping your retention at the same level.
</p>
</div>
</>
),
},
}
: null,
// Hiding if conversionGoal is set already because values aren't representative
!conversionGoal && featureFlags[FEATURE_FLAGS.WEB_ANALYTICS_CONVERSION_GOALS]
? {
Expand Down Expand Up @@ -1272,7 +1274,7 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([
},
}
: null,
featureFlags[FEATURE_FLAGS.WEB_ANALYTICS_REPLAY]
!conversionGoal && featureFlags[FEATURE_FLAGS.WEB_ANALYTICS_REPLAY]
? {
kind: 'replay',
tileId: TileId.REPLAY,
Expand All @@ -1287,8 +1289,7 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([
},
}
: null,
// TODO: What to do with this one if conversion goal is set? Hide it? Disable it?
featureFlags[FEATURE_FLAGS.ERROR_TRACKING]
!conversionGoal && featureFlags[FEATURE_FLAGS.ERROR_TRACKING]
? {
kind: 'error_tracking',
tileId: TileId.ERROR_TRACKING,
Expand Down

0 comments on commit dfd15b5

Please sign in to comment.