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.

4.5 KB
Raw Blame
import { FEATURE_FLAGS } from 'lib/constants'
import { urls } from 'scenes/urls'

import { ProductItemCategory, ProductKey } from '~/queries/schema/schema-general'

import { FileSystemIconColor, ProductManifest } from '../../frontend/src/types'

export const manifest: ProductManifest = {
    name: 'Web Analytics',
    // Boot-time approximation of webAnalyticsSetupLogic.
    setupProbe: {
        productKey: ProductKey.WEB_ANALYTICS,
        hasDataEvents: ['$pageview'],
    },
    urls: {
        webAnalytics: (): string => `/web`,
        webAnalyticsWebVitals: (): string => `/web/web-vitals`,
        webAnalyticsPageReports: (): string => `/web/page-reports`,
        webAnalyticsMarketing: (): string => `/web/marketing`,
        webAnalyticsHealth: (): string => `/web/health`,
        webAnalyticsLive: (): string => `/web/live`,
        webAnalyticsBotAnalytics: (): string => `/web/bot-analytics`,
        webAnalyticsContentAutopilot: (): string => `/web/content-autopilot`,
        heatmaps: (params?: string): string =>
            `/heatmaps${params ? `?${params.startsWith('?') ? params.slice(1) : params}` : ''}`,
        heatmapNew: (params?: string): string =>
            `/heatmaps/new${params ? `?${params.startsWith('?') ? params.slice(1) : params}` : ''}`,
        heatmapRecording: (params?: string): string =>
            `/heatmaps/recording${params ? `?${params.startsWith('?') ? params.slice(1) : params}` : ''}`,
        heatmap: (id: string | number): string => `/heatmaps/${id}`,
    },
    scenes: {
        Heatmaps: {
            name: 'Heatmaps',
            import: () => import('./frontend/heatmaps/scenes/heatmaps/HeatmapsScene'),
            projectBased: true,
            iconType: 'heatmap',
            description: 'Heatmaps are a way to visualize user behavior on your website.',
            docsHref: 'https://posthog.com/docs/toolbar/heatmaps',
        },
        Heatmap: {
            name: 'Heatmap',
            import: () => import('./frontend/heatmaps/scenes/heatmap/HeatmapScene'),
            projectBased: true,
            iconType: 'heatmap',
        },
        HeatmapNew: {
            name: 'New heatmap',
            import: () => import('./frontend/heatmaps/scenes/heatmap/HeatmapNewScene'),
            projectBased: true,
            iconType: 'heatmap',
        },
        HeatmapRecording: {
            name: 'Heatmap recording',
            import: () => import('./frontend/heatmaps/scenes/heatmap/HeatmapRecordingScene'),
            projectBased: true,
            iconType: 'heatmap',
        },
    },
    routes: {
        '/web/content-autopilot': ['WebAnalytics', 'webAnalyticsContentAutopilot'],
        '/heatmaps': ['Heatmaps', 'heatmaps'],
        '/heatmaps/new': ['HeatmapNew', 'heatmapNew'],
        '/heatmaps/recording': ['HeatmapRecording', 'heatmapRecording'],
        '/heatmaps/:id': ['Heatmap', 'heatmap'],
    },
    fileSystemTypes: {},
    treeItemsProducts: [
        {
            path: 'Web analytics',
            intents: [ProductKey.WEB_ANALYTICS],
            category: ProductItemCategory.ANALYTICS,
            iconType: 'web_analytics',
            iconColor: ['var(--color-product-web-analytics-light)'] as FileSystemIconColor,
            href: urls.webAnalytics(),
            searchKeywords: ['traffic', 'pageviews', 'visitors', 'bounce rate', 'referrers'],
            searchTabs: [
                { name: 'Web vitals', href: urls.webAnalyticsWebVitals() },
                { name: 'Page reports', href: urls.webAnalyticsPageReports() },
                { name: 'Live', href: urls.webAnalyticsLive() },
                { name: 'Installation health', href: urls.webAnalyticsHealth() },
                {
                    name: 'AI visibility',
                    href: urls.webAnalyticsContentAutopilot(),
                    flag: FEATURE_FLAGS.WEB_ANALYTICS_CONTENT_AUTOPILOT,
                },
                {
                    name: 'Bots',
                    href: urls.webAnalyticsBotAnalytics(),
                    flag: FEATURE_FLAGS.WEB_ANALYTICS_CONTENT_AUTOPILOT,
                },
                {
                    name: 'Search & AI',
                    href: urls.webAnalyticsPagePerformance(),
                    flag: FEATURE_FLAGS.WEB_ANALYTICS_PAGE_PERFORMANCE,
                },
                { name: 'Agents', href: urls.webAnalyticsAgents(), flag: FEATURE_FLAGS.WEB_ANALYTICS_AGENT_ANALYTICS },
            ],
            sceneKey: 'WebAnalytics',
            sceneKeys: ['WebAnalytics'],
        },
    ],
    treeItemsMetadata: [],
}