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(endpoints): record product intent on endpoints scene view (#61341)

Anna Szell515f82985bc7
diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.json
index 39bae745cb8c..937b52fbce8a 100644
--- a/frontend/src/queries/schema.json
+++ b/frontend/src/queries/schema.json
@@ -29002,6 +29002,7 @@
"task_created",
"toolbar_launched",
"vercel_integration",
+ "endpoints_viewed",
"endpoint_created",
"endpoint_created_from_insight",
"endpoint_created_from_sql_editor",
diff --git a/frontend/src/queries/schema/schema-general.ts b/frontend/src/queries/schema/schema-general.ts
index 2c809a1ef0a9..d07561af3ce5 100644
--- a/frontend/src/queries/schema/schema-general.ts
+++ b/frontend/src/queries/schema/schema-general.ts
@@ -6775,6 +6775,7 @@ export enum ProductIntentContext {
VERCEL_INTEGRATION = 'vercel_integration',
// Endpoints
+ ENDPOINTS_VIEWED = 'endpoints_viewed',
ENDPOINT_CREATED = 'endpoint_created',
ENDPOINT_CREATED_FROM_INSIGHT = 'endpoint_created_from_insight',
ENDPOINT_CREATED_FROM_SQL_EDITOR = 'endpoint_created_from_sql_editor',
diff --git a/posthog/schema.py b/posthog/schema.py
index 33c97df00c4f..8fe83dbb99e8 100644
--- a/posthog/schema.py
+++ b/posthog/schema.py
@@ -3993,6 +3993,7 @@ class ProductIntentContext(StrEnum):
TASK_CREATED = "task_created"
TOOLBAR_LAUNCHED = "toolbar_launched"
VERCEL_INTEGRATION = "vercel_integration"
+ ENDPOINTS_VIEWED = "endpoints_viewed"
ENDPOINT_CREATED = "endpoint_created"
ENDPOINT_CREATED_FROM_INSIGHT = "endpoint_created_from_insight"
ENDPOINT_CREATED_FROM_SQL_EDITOR = "endpoint_created_from_sql_editor"
diff --git a/products/endpoints/frontend/endpointsLogic.tsx b/products/endpoints/frontend/endpointsLogic.tsx
index ecbb4d4cd1b2..c25707b10683 100644
--- a/products/endpoints/frontend/endpointsLogic.tsx
+++ b/products/endpoints/frontend/endpointsLogic.tsx
@@ -1,11 +1,13 @@
-import { actions, afterMount, kea, key, path, props, reducers, selectors } from 'kea'
+import { actions, afterMount, connect, kea, key, path, props, reducers, selectors } from 'kea'
import { loaders } from 'kea-loaders'
import api from 'lib/api'
import { tabAwareUrlToAction } from 'lib/logic/scenes/tabAwareUrlToAction'
import { createFuse } from 'lib/utils/fuseSearch'
+import { teamLogic } from 'scenes/teamLogic'
import { urls } from 'scenes/urls'
+import { ProductIntentContext, ProductKey } from '~/queries/schema/schema-general'
import { EndpointType } from '~/types'
import type { endpointsLogicType } from './endpointsLogicType'
@@ -30,6 +32,9 @@ export const endpointsLogic = kea<endpointsLogicType>([
path(['products', 'endpoints', 'frontend', 'endpointsLogic']),
props({} as EndpointsLogicProps),
key((props) => props.tabId),
+ connect(() => ({
+ actions: [teamLogic, ['addProductIntent']],
+ })),
actions({
setFilters: (filters: Partial<EndpointsFilters>) => ({ filters }),
setActiveTab: (activeTab: EndpointsTab) => ({ activeTab }),
@@ -84,6 +89,10 @@ export const endpointsLogic = kea<endpointsLogicType>([
}),
afterMount(({ actions }) => {
actions.loadEndpoints()
+ actions.addProductIntent({
+ product_type: ProductKey.ENDPOINTS,
+ intent_context: ProductIntentContext.ENDPOINTS_VIEWED,
+ })
}),
tabAwareUrlToAction(({ actions }) => ({