Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(insights): track public sharing (#101628)

posthog[bot]1d4b9932adf7
diff --git a/frontend/src/lib/components/Sharing/sharingLogic.ts b/frontend/src/lib/components/Sharing/sharingLogic.ts
index 3aea5c1c2edd..cf92c410181a 100644
--- a/frontend/src/lib/components/Sharing/sharingLogic.ts
+++ b/frontend/src/lib/components/Sharing/sharingLogic.ts
@@ -387,6 +387,8 @@ export const sharingLogic = kea<sharingLogicType>([
setIsEnabled: (enabled) => {
if (props.dashboardId) {
posthog.capture(`dashboard share toggled`, { dashboard_id: props.dashboardId, is_shared: enabled })
+ } else if (props.insightShortId) {
+ posthog.capture('insight share toggled', { insight_short_id: props.insightShortId, is_shared: enabled })
}
},
setIsEnabledSuccess: () => {
diff --git a/frontend/src/scenes/insights/SidePanel/InsightPanelActions.tsx b/frontend/src/scenes/insights/SidePanel/InsightPanelActions.tsx
index b36e37fd09ec..1927bedaa870 100644
--- a/frontend/src/scenes/insights/SidePanel/InsightPanelActions.tsx
+++ b/frontend/src/scenes/insights/SidePanel/InsightPanelActions.tsx
@@ -150,7 +150,7 @@ export function InsightPanelActions({ insightLogicProps }: { insightLogicProps:
}}
dataAttrKey={RESOURCE_TYPE}
disabledReasons={{
- 'You must save the insight first before sharing it as a template': !isSavedInsight,
+ 'You must save the insight first before sharing it': !isSavedInsight,
...(sharingDisabledReason ? { [sharingDisabledReason]: true } : {}),
}}
/>