diff --git a/frontend/src/lib/utils/eventUsageLogic.ts b/frontend/src/lib/utils/eventUsageLogic.ts index 3ccbda3b72d..17f5e8dc000 100644 --- a/frontend/src/lib/utils/eventUsageLogic.ts +++ b/frontend/src/lib/utils/eventUsageLogic.ts @@ -5,6 +5,7 @@ import posthog from 'posthog-js' import { userLogic } from 'scenes/userLogic' import { eventUsageLogicType } from './eventUsageLogicType' import { AnnotationType, FilterType, DashboardType } from '~/types' +import { ViewType } from 'scenes/insights/insightLogic' const keyMappingKeys = Object.keys(keyMapping.event) @@ -143,7 +144,7 @@ export const eventUsageLogic = kea({ } for (const item of dashboard.items) { - const key = `${item.filters.insight.toLowerCase()}_count` + const key = `${item.filters?.insight?.toLowerCase() || ViewType.TRENDS}_count` if (!properties[key]) { properties[key] = 1 } else {