diff --git a/frontend/src/layout/navigation-3000/sidepanel/panels/activation/SidePanelActivation.tsx b/frontend/src/layout/navigation-3000/sidepanel/panels/activation/SidePanelActivation.tsx index 4c4358bc21bcd..5aef55b51a523 100644 --- a/frontend/src/layout/navigation-3000/sidepanel/panels/activation/SidePanelActivation.tsx +++ b/frontend/src/layout/navigation-3000/sidepanel/panels/activation/SidePanelActivation.tsx @@ -78,7 +78,7 @@ const ActivationTask = ({ }: ActivationTaskType): JSX.Element => { const displaySideAction = !completed && !skipped && canSkip const { runTask, skipTask } = useActions(activationLogic) - const { reportActivationSideBarTaskClicked, reportActivationSideBarTaskSkipped } = useActions(eventUsageLogic) + const { reportActivationSideBarTaskClicked } = useActions(eventUsageLogic) const content = (
@@ -87,11 +87,6 @@ const ActivationTask = ({
) - const handleSkip = (): void => { - skipTask(id) - reportActivationSideBarTaskSkipped(id) - } - const params: Partial = { id, fullWidth: true, @@ -119,7 +114,7 @@ const ActivationTask = ({ sideAction={{ icon: , tooltip: 'Skip task', - onClick: () => handleSkip(), + onClick: () => skipTask(id), }} > {content} diff --git a/frontend/src/layout/navigation-3000/sidepanel/panels/activation/activationLogic.ts b/frontend/src/layout/navigation-3000/sidepanel/panels/activation/activationLogic.ts index 7638f82300bec..8709ce0c0c0ee 100644 --- a/frontend/src/layout/navigation-3000/sidepanel/panels/activation/activationLogic.ts +++ b/frontend/src/layout/navigation-3000/sidepanel/panels/activation/activationLogic.ts @@ -3,6 +3,7 @@ import { loaders } from 'kea-loaders' import { router } from 'kea-router' import api from 'lib/api' import { permanentlyMount } from 'lib/utils/kea-logic-builders' +import posthog from 'posthog-js' import { membersLogic } from 'scenes/organization/membersLogic' import { pluginsLogic } from 'scenes/plugins/pluginsLogic' import { savedInsightsLogic } from 'scenes/saved-insights/savedInsightsLogic' @@ -24,7 +25,7 @@ export enum ActivationTasks { SetupSessionRecordings = 'setup_session_recordings', TrackCustomEvents = 'track_custom_events', InstallFirstApp = 'install_first_app', - SetupReverseProxy = 'setup_reverse_proxy', + SetUpReverseProxy = 'set_up_reverse_proxy', } export type ActivationTaskType = { @@ -280,14 +281,14 @@ export const activationLogic = kea([ skipped: skippedTasks.includes(ActivationTasks.InstallFirstApp), }) break - case ActivationTasks.SetupReverseProxy: + case ActivationTasks.SetUpReverseProxy: tasks.push({ - id: ActivationTasks.SetupReverseProxy, + id: ActivationTasks.SetUpReverseProxy, name: 'Set up a reverse proxy', description: 'Sent your events from your own domain to avoid tracking blockers', completed: false, canSkip: true, - skipped: skippedTasks.includes(ActivationTasks.SetupReverseProxy), + skipped: skippedTasks.includes(ActivationTasks.SetUpReverseProxy), url: 'https://posthog.com/docs/advanced/proxy', }) break @@ -351,6 +352,9 @@ export const activationLogic = kea([ } }, skipTask: ({ id }) => { + posthog.capture('activation sidebar task skipped', { + key: id, + }) if (values.currentTeam?.id) { actions.addSkippedTask(values.currentTeam.id, id) } diff --git a/frontend/src/layout/navigation-3000/sidepanel/sidePanelStateLogic.tsx b/frontend/src/layout/navigation-3000/sidepanel/sidePanelStateLogic.tsx index 6d1360cdf90ac..8c1aa956fcffb 100644 --- a/frontend/src/layout/navigation-3000/sidepanel/sidePanelStateLogic.tsx +++ b/frontend/src/layout/navigation-3000/sidepanel/sidePanelStateLogic.tsx @@ -1,6 +1,7 @@ import { actions, kea, listeners, path, reducers } from 'kea' import { actionToUrl, router, urlToAction } from 'kea-router' import { windowValues } from 'kea-window-values' +import posthog from 'posthog-js' import { SidePanelTab } from '~/types' @@ -55,10 +56,12 @@ export const sidePanelStateLogic = kea([ listeners(({ actions, values }) => ({ // NOTE: We explicitly reference the actions instead of connecting so that people don't accidentally // use this logic instead of sidePanelStateLogic - openSidePanel: () => { + openSidePanel: ({ tab }) => { + posthog.capture('activation sidebar closed', { tab }) actions.setSidePanelOpen(true) }, closeSidePanel: ({ tab }) => { + posthog.capture('activation sidebar opened', { tab }) if (!tab) { // If we aren't specifiying the tab we always close actions.setSidePanelOpen(false) diff --git a/frontend/src/lib/utils/eventUsageLogic.ts b/frontend/src/lib/utils/eventUsageLogic.ts index 549ed97b04943..d4c6a9be07d2c 100644 --- a/frontend/src/lib/utils/eventUsageLogic.ts +++ b/frontend/src/lib/utils/eventUsageLogic.ts @@ -43,7 +43,6 @@ import { SessionPlayerData, SessionRecordingPlayerTab, SessionRecordingUsageType, - SidePanelTab, Survey, } from '~/types' @@ -458,10 +457,7 @@ export const eventUsageLogic = kea([ reportInstanceSettingChange: (name: string, value: string | boolean | number) => ({ name, value }), reportAxisUnitsChanged: (properties: Record) => ({ ...properties }), reportTeamSettingChange: (name: string, value: any) => ({ name, value }), - reportActivationSideBarOpened: (tab: SidePanelTab) => ({ tab }), - reportActivationSideBarClosed: (tab?: SidePanelTab) => ({ tab }), reportActivationSideBarTaskClicked: (key: string) => ({ key }), - reportActivationSideBarTaskSkipped: (key: string) => ({ key }), reportBillingUpgradeClicked: (plan: string) => ({ plan }), reportRoleCreated: (role: string) => ({ role }), reportResourceAccessLevelUpdated: (resourceType: Resource, roleName: string, accessLevel: AccessLevel) => ({ @@ -1087,26 +1083,11 @@ export const eventUsageLogic = kea([ value, }) }, - reportActivationSideBarOpened: ({ tab }) => { - posthog.capture('activation sidebar opened', { - tab, - }) - }, - reportActivationSideBarClosed: ({ tab }) => { - posthog.capture('activation sidebar closed', { - tab, - }) - }, reportActivationSideBarTaskClicked: ({ key }) => { posthog.capture('activation sidebar task clicked', { key, }) }, - reportActivationSideBarTaskSkipped: ({ key }) => { - posthog.capture('activation sidebar task skipped', { - key, - }) - }, reportBillingUpgradeClicked: ({ plan }) => { posthog.capture('billing upgrade button clicked', { plan,