diff --git a/frontend/src/lib/components/Sharing/SharingModal.tsx b/frontend/src/lib/components/Sharing/SharingModal.tsx index 7ef76f6fc54d6..c4d53a20ef386 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, setEmbedConfigValue } = useActions(sharingLogic(logicProps)) const { guardAvailableFeature } = useValues(upgradeModalLogic) const [iframeLoaded, setIframeLoaded] = useState(false) @@ -159,7 +159,7 @@ export function SharingModalContent({ )} - {({ value, onChange }) => ( + {({ value }) => ( } onChange={() => - guardAvailableFeature(AvailableFeature.WHITE_LABELLING, () => - onChange(!value) - ) + guardAvailableFeature(AvailableFeature.WHITE_LABELLING, () => { + setEmbedConfigValue('whitelabel', !value) + }) } checked={!value} /> diff --git a/frontend/src/lib/components/Sharing/sharingLogic.ts b/frontend/src/lib/components/Sharing/sharingLogic.ts index 701fe9e5c9704..8d79928ad2036 100644 --- a/frontend/src/lib/components/Sharing/sharingLogic.ts +++ b/frontend/src/lib/components/Sharing/sharingLogic.ts @@ -86,6 +86,11 @@ export const sharingLogic = kea([ dashboardsModel.actions.loadDashboards() } }, + setEmbedConfigValue: ({ name, value }) => { + if (name === 'whitelabel' && props.dashboardId) { + eventUsageLogic.actions.reportDashboardWhitelabelToggled(value) + } + }, })), forms({ diff --git a/frontend/src/lib/utils/eventUsageLogic.ts b/frontend/src/lib/utils/eventUsageLogic.ts index 39487ede8f5e0..78a79e0bd6e7c 100644 --- a/frontend/src/lib/utils/eventUsageLogic.ts +++ b/frontend/src/lib/utils/eventUsageLogic.ts @@ -399,6 +399,7 @@ export const eventUsageLogic = kea([ newLength: number ) => ({ attribute, originalLength, newLength }), reportDashboardShareToggled: (isShared: boolean) => ({ isShared }), + reportDashboardWhitelabelToggled: (isWhiteLabelled: boolean) => ({ isWhiteLabelled }), reportUpgradeModalShown: (featureName: string) => ({ featureName }), reportTimezoneComponentViewed: ( component: 'label' | 'indicator', @@ -791,6 +792,9 @@ export const eventUsageLogic = kea([ reportDashboardShareToggled: async ({ isShared }) => { posthog.capture(`dashboard share toggled`, { is_shared: isShared }) }, + reportDashboardWhitelabelToggled: async ({ isWhiteLabelled }) => { + posthog.capture(`dashboard whitelabelled`, { is_whitelabelled: isWhiteLabelled }) + }, reportUpgradeModalShown: async (payload) => { posthog.capture('upgrade modal shown', payload) },