diff --git a/frontend/src/lib/components/Sharing/SharingModal.tsx b/frontend/src/lib/components/Sharing/SharingModal.tsx index 7ef76f6fc54d67..e699d2f82f828c 100644 --- a/frontend/src/lib/components/Sharing/SharingModal.tsx +++ b/frontend/src/lib/components/Sharing/SharingModal.tsx @@ -65,7 +65,7 @@ export function SharingModalContent({ iframeProperties, shareLink, } = useValues(sharingLogic(logicProps)) - const { setIsEnabled, togglePreview } = useActions(sharingLogic(logicProps)) + const { setIsEnabled, togglePreview, captureWhitelabelToggled } = useActions(sharingLogic(logicProps)) const { guardAvailableFeature } = useValues(upgradeModalLogic) const [iframeLoaded, setIframeLoaded] = useState(false) @@ -174,9 +174,10 @@ export function SharingModalContent({ } onChange={() => - guardAvailableFeature(AvailableFeature.WHITE_LABELLING, () => + guardAvailableFeature(AvailableFeature.WHITE_LABELLING, () => { onChange(!value) - ) + captureWhitelabelToggled(!value) + }) } checked={!value} /> diff --git a/frontend/src/lib/components/Sharing/sharingLogic.ts b/frontend/src/lib/components/Sharing/sharingLogic.ts index 701fe9e5c9704c..a977327b0e96c2 100644 --- a/frontend/src/lib/components/Sharing/sharingLogic.ts +++ b/frontend/src/lib/components/Sharing/sharingLogic.ts @@ -3,6 +3,7 @@ import { forms } from 'kea-forms' import { loaders } from 'kea-loaders' import api from 'lib/api' import { eventUsageLogic } from 'lib/utils/eventUsageLogic' +import posthog from 'posthog-js' import { getInsightId } from 'scenes/insights/utils' import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic' import { urls } from 'scenes/urls' @@ -57,6 +58,7 @@ export const sharingLogic = kea([ actions({ togglePreview: true, + captureWhitelabelToggled: (enabled: boolean) => ({ enabled }), }), reducers({ showPreview: [true, { togglePreview: (state) => !state }], @@ -86,8 +88,10 @@ export const sharingLogic = kea([ dashboardsModel.actions.loadDashboards() } }, + captureWhitelabelToggled: ({ enabled }) => { + posthog.capture('sharing whitelabel toggled', { enabled }) + }, })), - forms({ embedConfig: { defaults: defaultEmbedConfig,