diff --git a/frontend/src/lib/utils/eventUsageLogic.ts b/frontend/src/lib/utils/eventUsageLogic.ts index 80f26932101e1..4b1ddcd3e2054 100644 --- a/frontend/src/lib/utils/eventUsageLogic.ts +++ b/frontend/src/lib/utils/eventUsageLogic.ts @@ -480,6 +480,11 @@ export const eventUsageLogic = kea([ }), reportExperimentInsightLoadFailed: true, reportExperimentVariantShipped: (experiment: Experiment) => ({ experiment }), + reportExperimentVariantScreenshotUploaded: (experimentId: number | 'new') => ({ experimentId }), + reportExperimentResultsLoadingTimeout: (experimentId: number | 'new') => ({ experimentId }), + reportExperimentReleaseConditionsViewed: (experimentId: number | 'new') => ({ experimentId }), + reportExperimentReleaseConditionsUpdated: (experimentId: number | 'new') => ({ experimentId }), + // Definition Popover reportDataManagementDefinitionHovered: (type: TaxonomicFilterGroupType) => ({ type }), reportDataManagementDefinitionClickView: (type: TaxonomicFilterGroupType) => ({ type }), @@ -1051,6 +1056,26 @@ export const eventUsageLogic = kea([ secondary_metrics_count: experiment.secondary_metrics.length, }) }, + reportExperimentVariantScreenshotUploaded: ({ experimentId }) => { + posthog.capture('experiment variant screenshot uploaded', { + experiment_id: experimentId, + }) + }, + reportExperimentResultsLoadingTimeout: ({ experimentId }) => { + posthog.capture('experiment results loading timeout', { + experiment_id: experimentId, + }) + }, + reportExperimentReleaseConditionsViewed: ({ experimentId }) => { + posthog.capture('experiment release conditions viewed', { + experiment_id: experimentId, + }) + }, + reportExperimentReleaseConditionsUpdated: ({ experimentId }) => { + posthog.capture('experiment release conditions updated', { + experiment_id: experimentId, + }) + }, reportPropertyGroupFilterAdded: () => { posthog.capture('property group filter added') }, diff --git a/frontend/src/scenes/experiments/ExperimentView/DistributionTable.tsx b/frontend/src/scenes/experiments/ExperimentView/DistributionTable.tsx index 708facb73bd46..b7aa63829482b 100644 --- a/frontend/src/scenes/experiments/ExperimentView/DistributionTable.tsx +++ b/frontend/src/scenes/experiments/ExperimentView/DistributionTable.tsx @@ -13,6 +13,7 @@ import { VariantScreenshot } from './VariantScreenshot' export function DistributionTable(): JSX.Element { const { experimentId, experiment, experimentResults } = useValues(experimentLogic) + const { reportExperimentReleaseConditionsViewed } = useActions(experimentLogic) const { openSidePanel } = useActions(sidePanelStateLogic) const columns: LemonTableColumns = [ @@ -60,7 +61,10 @@ export function DistributionTable(): JSX.Element {
} - onClick={() => openSidePanel(SidePanelTab.ExperimentFeatureFlag)} + onClick={() => { + openSidePanel(SidePanelTab.ExperimentFeatureFlag) + reportExperimentReleaseConditionsViewed(experiment.id) + }} type="secondary" size="xsmall" className="font-semibold" diff --git a/frontend/src/scenes/experiments/ExperimentView/ReleaseConditionsTable.tsx b/frontend/src/scenes/experiments/ExperimentView/ReleaseConditionsTable.tsx index 0f31b8929bf8b..5b9c8bac492bb 100644 --- a/frontend/src/scenes/experiments/ExperimentView/ReleaseConditionsTable.tsx +++ b/frontend/src/scenes/experiments/ExperimentView/ReleaseConditionsTable.tsx @@ -12,6 +12,7 @@ import { experimentLogic } from '../experimentLogic' export function ReleaseConditionsTable(): JSX.Element { const { experiment } = useValues(experimentLogic) + const { reportExperimentReleaseConditionsViewed } = useActions(experimentLogic) const { aggregationLabel } = useValues(groupsModel) const { openSidePanel } = useActions(sidePanelStateLogic) @@ -65,7 +66,10 @@ export function ReleaseConditionsTable(): JSX.Element {
} - onClick={() => openSidePanel(SidePanelTab.ExperimentFeatureFlag)} + onClick={() => { + openSidePanel(SidePanelTab.ExperimentFeatureFlag) + reportExperimentReleaseConditionsViewed(experiment.id) + }} type="secondary" size="xsmall" className="font-semibold" diff --git a/frontend/src/scenes/experiments/ExperimentView/VariantScreenshot.tsx b/frontend/src/scenes/experiments/ExperimentView/VariantScreenshot.tsx index c80bcd574ed0f..3580428d04175 100644 --- a/frontend/src/scenes/experiments/ExperimentView/VariantScreenshot.tsx +++ b/frontend/src/scenes/experiments/ExperimentView/VariantScreenshot.tsx @@ -15,7 +15,7 @@ export function VariantScreenshot({ rolloutPercentage: number }): JSX.Element { const { experiment } = useValues(experimentLogic) - const { updateExperimentVariantImages } = useActions(experimentLogic) + const { updateExperimentVariantImages, reportExperimentVariantScreenshotUploaded } = useActions(experimentLogic) const [mediaId, setMediaId] = useState(experiment.parameters?.variant_screenshot_media_ids?.[variantKey] || null) const [isLoadingImage, setIsLoadingImage] = useState(true) @@ -30,6 +30,7 @@ export function VariantScreenshot({ [variantKey]: id, } updateExperimentVariantImages(updatedVariantImages) + reportExperimentVariantScreenshotUploaded(experiment.id) } }, onError: (detail) => { diff --git a/frontend/src/scenes/experiments/experimentLogic.tsx b/frontend/src/scenes/experiments/experimentLogic.tsx index f93ce8c45abe1..2049d6cbce2d8 100644 --- a/frontend/src/scenes/experiments/experimentLogic.tsx +++ b/frontend/src/scenes/experiments/experimentLogic.tsx @@ -126,6 +126,9 @@ export const experimentLogic = kea([ 'reportExperimentReset', 'reportExperimentExposureCohortCreated', 'reportExperimentVariantShipped', + 'reportExperimentVariantScreenshotUploaded', + 'reportExperimentResultsLoadingTimeout', + 'reportExperimentReleaseConditionsViewed', ], insightDataLogic({ dashboardItemId: EXPERIMENT_INSIGHT_ID }), ['setQuery'], @@ -775,6 +778,9 @@ export const experimentLogic = kea([ } } catch (error: any) { actions.setExperimentResultCalculationError({ detail: error.detail, statusCode: error.status }) + if (error.status === 504) { + actions.reportExperimentResultsLoadingTimeout(values.experimentId) + } return null } }, diff --git a/frontend/src/scenes/feature-flags/featureFlagLogic.ts b/frontend/src/scenes/feature-flags/featureFlagLogic.ts index 2f2933cf9335e..f01c917bd8a9a 100644 --- a/frontend/src/scenes/feature-flags/featureFlagLogic.ts +++ b/frontend/src/scenes/feature-flags/featureFlagLogic.ts @@ -706,6 +706,7 @@ export const featureFlagLogic = kea([ const experimentId = currentPath.split('/').pop() if (experimentId) { + eventUsageLogic.actions.reportExperimentReleaseConditionsUpdated(parseInt(experimentId)) experimentLogic({ experimentId: parseInt(experimentId) }).actions.loadExperiment() } },