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.

21.3 KB
Raw Blame
import { DashboardTemplateStoredInsightTile } from '~/types'

// Mirrors the Website Metrics dashboard used to design the metric card experiment.
export const WEBSITE_METRICS_METRIC_CARD_TILES: DashboardTemplateStoredInsightTile[] = [
    {
        type: 'INSIGHT',
        name: 'Daily visitors',
        description: '',
        query: {
            kind: 'InsightVizNode',
            source: {
                kind: 'TrendsQuery',
                series: [
                    {
                        kind: 'EventsNode',
                        math: 'dau',
                        name: '$pageview',
                        event: '$pageview',
                    },
                ],
                version: 4,
                interval: 'day',
                dateRange: {
                    date_from: '-30d',
                    explicitDate: false,
                    excludeIncompletePeriods: true,
                },
                properties: [],
                trendsFilter: {
                    display: 'Metric',
                    showLegend: false,
                    hideWeekends: false,
                    metricSummary: 'average',
                    legendPosition: 'bottom',
                    yAxisScaleType: 'linear',
                    showAnnotations: true,
                    metricShowChange: true,
                    yAxisStartAtZero: true,
                    showMultipleYAxes: false,
                    showValuesOnSeries: false,
                    smoothingIntervals: 1,
                    showPercentStackView: false,
                    stackBreakdownValues: false,
                    aggregationAxisFormat: 'short',
                    resultCustomizationBy: 'value',
                    excludeBoxPlotOutliers: true,
                    metricColorByDirection: true,
                    metricLineDecreaseColor: '#8c8c8c',
                    metricLineIncreaseColor: '#1d4aff',
                    showAlertThresholdLines: false,
                },
                compareFilter: {
                    compare: true,
                },
                filterTestAccounts: false,
            },
        },
        layouts: {
            sm: {
                x: 0,
                y: 0,
                w: 3,
                h: 3,
                minW: 2,
                minH: 2,
            },
            xs: {
                x: 0,
                y: 0,
                w: 1,
                h: 3,
                minW: 1,
                minH: 2,
            },
        },
    },
    {
        type: 'INSIGHT',
        name: 'Sessions',
        description: '',
        query: {
            kind: 'InsightVizNode',
            source: {
                kind: 'TrendsQuery',
                series: [
                    {
                        kind: 'EventsNode',
                        math: 'unique_session',
                        name: '$pageview',
                        event: '$pageview',
                    },
                ],
                version: 4,
                interval: 'day',
                dateRange: {
                    date_from: '-30d',
                    explicitDate: false,
                    excludeIncompletePeriods: true,
                },
                properties: [],
                trendsFilter: {
                    display: 'Metric',
                    showLegend: false,
                    hideWeekends: false,
                    metricSummary: 'total',
                    legendPosition: 'bottom',
                    yAxisScaleType: 'linear',
                    showAnnotations: true,
                    metricShowChange: true,
                    yAxisStartAtZero: true,
                    showMultipleYAxes: false,
                    showValuesOnSeries: false,
                    smoothingIntervals: 1,
                    showPercentStackView: false,
                    stackBreakdownValues: false,
                    aggregationAxisFormat: 'short',
                    resultCustomizationBy: 'value',
                    excludeBoxPlotOutliers: true,
                    metricColorByDirection: true,
                    metricLineDecreaseColor: '#8c8c8c',
                    metricLineIncreaseColor: '#621da6',
                    showAlertThresholdLines: false,
                },
                compareFilter: {
                    compare: true,
                },
                filterTestAccounts: false,
            },
        },
        layouts: {
            sm: {
                x: 3,
                y: 0,
                w: 3,
                h: 3,
                minW: 2,
                minH: 2,
            },
            xs: {
                x: 0,
                y: 3,
                w: 1,
                h: 3,
                minW: 1,
                minH: 2,
            },
        },
    },
    {
        type: 'INSIGHT',
        name: 'Pageviews',
        description: '',
        query: {
            kind: 'InsightVizNode',
            source: {
                kind: 'TrendsQuery',
                series: [
                    {
                        kind: 'EventsNode',
                        math: 'total',
                        name: '$pageview',
                        event: '$pageview',
                    },
                ],
                version: 4,
                interval: 'day',
                dateRange: {
                    date_from: '-30d',
                    explicitDate: false,
                    excludeIncompletePeriods: true,
                },
                properties: [],
                trendsFilter: {
                    display: 'Metric',
                    showLegend: false,
                    hideWeekends: false,
                    metricSummary: 'total',
                    legendPosition: 'bottom',
                    yAxisScaleType: 'linear',
                    showAnnotations: true,
                    metricShowChange: true,
                    yAxisStartAtZero: true,
                    showMultipleYAxes: false,
                    showValuesOnSeries: false,
                    smoothingIntervals: 1,
                    showPercentStackView: false,
                    stackBreakdownValues: false,
                    aggregationAxisFormat: 'short',
                    resultCustomizationBy: 'value',
                    excludeBoxPlotOutliers: true,
                    metricColorByDirection: true,
                    metricLineDecreaseColor: '#8c8c8c',
                    metricLineIncreaseColor: '#42827e',
                    showAlertThresholdLines: false,
                },
                compareFilter: {
                    compare: true,
                },
                filterTestAccounts: false,
            },
        },
        layouts: {
            sm: {
                x: 6,
                y: 0,
                w: 3,
                h: 3,
                minW: 2,
                minH: 2,
            },
            xs: {
                x: 0,
                y: 6,
                w: 1,
                h: 3,
                minW: 1,
                minH: 2,
            },
        },
    },
    {
        type: 'INSIGHT',
        name: 'Pageviews per session',
        description: '',
        query: {
            kind: 'InsightVizNode',
            source: {
                kind: 'TrendsQuery',
                series: [
                    {
                        kind: 'EventsNode',
                        math: 'total',
                        name: '$pageview',
                        event: '$pageview',
                        custom_name: 'Pageviews',
                    },
                    {
                        kind: 'EventsNode',
                        math: 'unique_session',
                        name: '$pageview',
                        event: '$pageview',
                        custom_name: 'Sessions',
                    },
                ],
                version: 4,
                interval: 'day',
                dateRange: {
                    date_from: '-30d',
                    explicitDate: false,
                    excludeIncompletePeriods: true,
                },
                properties: [],
                trendsFilter: {
                    display: 'Metric',
                    formula: 'A / B',
                    showLegend: false,
                    hideWeekends: false,
                    decimalPlaces: 1,
                    metricSummary: 'total',
                    legendPosition: 'bottom',
                    yAxisScaleType: 'linear',
                    showAnnotations: true,
                    metricShowChange: true,
                    yAxisStartAtZero: true,
                    showMultipleYAxes: false,
                    showValuesOnSeries: false,
                    smoothingIntervals: 1,
                    showPercentStackView: false,
                    stackBreakdownValues: false,
                    aggregationAxisFormat: 'short',
                    resultCustomizationBy: 'value',
                    excludeBoxPlotOutliers: true,
                    metricColorByDirection: true,
                    metricLineDecreaseColor: '#e4a604',
                    metricLineIncreaseColor: '#ce0e74',
                    showAlertThresholdLines: false,
                },
                compareFilter: {
                    compare: true,
                },
                filterTestAccounts: false,
            },
        },
        layouts: {
            sm: {
                x: 9,
                y: 0,
                w: 3,
                h: 3,
                minW: 2,
                minH: 2,
            },
            xs: {
                x: 0,
                y: 9,
                w: 1,
                h: 3,
                minW: 1,
                minH: 2,
            },
        },
    },
    {
        type: 'INSIGHT',
        name: 'Sessions by channel',
        description: 'Where sessions come from: organic search, direct, referral, paid, social and so on.',
        query: {
            kind: 'InsightVizNode',
            source: {
                kind: 'TrendsQuery',
                series: [
                    {
                        kind: 'EventsNode',
                        math: 'unique_session',
                        name: '$pageview',
                        event: '$pageview',
                    },
                ],
                version: 4,
                interval: 'day',
                dateRange: {
                    date_from: '-30d',
                    explicitDate: false,
                    excludeIncompletePeriods: false,
                },
                properties: [],
                trendsFilter: {
                    display: 'ActionsAreaGraph',
                    showLegend: true,
                    hideWeekends: false,
                    metricSummary: 'total',
                    legendPosition: 'bottom',
                    yAxisScaleType: 'linear',
                    showAnnotations: false,
                    metricShowChange: true,
                    yAxisStartAtZero: true,
                    showMultipleYAxes: false,
                    showValuesOnSeries: false,
                    smoothingIntervals: 1,
                    showPercentStackView: false,
                    stackBreakdownValues: false,
                    aggregationAxisFormat: 'numeric',
                    resultCustomizationBy: 'value',
                    excludeBoxPlotOutliers: true,
                    metricColorByDirection: false,
                    showAlertThresholdLines: false,
                },
                breakdownFilter: {
                    breakdown: '$channel_type',
                    breakdown_type: 'session',
                    breakdown_limit: 8,
                },
                filterTestAccounts: false,
            },
        },
        layouts: {
            sm: {
                x: 0,
                y: 3,
                w: 6,
                h: 5,
                minW: 2,
                minH: 2,
            },
            xs: {
                x: 0,
                y: 12,
                w: 1,
                h: 5,
                minW: 1,
                minH: 2,
            },
        },
    },
    {
        type: 'INSIGHT',
        name: 'Top Website Pages',
        description: '',
        query: {
            kind: 'InsightVizNode',
            source: {
                kind: 'TrendsQuery',
                series: [
                    {
                        kind: 'EventsNode',
                        math: 'unique_session',
                        name: '$pageview',
                        event: '$pageview',
                    },
                ],
                version: 4,
                interval: 'day',
                dateRange: {
                    date_from: '-30d',
                    explicitDate: false,
                    excludeIncompletePeriods: false,
                },
                properties: [],
                trendsFilter: {
                    display: 'ActionsBarValue',
                    showLegend: false,
                    hideWeekends: false,
                    metricSummary: 'total',
                    legendPosition: 'bottom',
                    yAxisScaleType: 'linear',
                    showAnnotations: true,
                    metricShowChange: true,
                    yAxisStartAtZero: true,
                    showMultipleYAxes: false,
                    showValuesOnSeries: false,
                    smoothingIntervals: 1,
                    showPercentStackView: false,
                    stackBreakdownValues: false,
                    aggregationAxisFormat: 'short',
                    resultCustomizationBy: 'value',
                    excludeBoxPlotOutliers: true,
                    metricColorByDirection: false,
                    showAlertThresholdLines: false,
                },
                breakdownFilter: {
                    breakdown: '$pathname',
                    breakdown_type: 'event',
                    breakdown_limit: 10,
                    breakdown_hide_other_aggregation: true,
                },
                filterTestAccounts: false,
            },
        },
        layouts: {
            sm: {
                x: 6,
                y: 3,
                w: 6,
                h: 5,
                minW: 2,
                minH: 2,
            },
            xs: {
                x: 0,
                y: 17,
                w: 1,
                h: 5,
                minW: 1,
                minH: 2,
            },
        },
    },
    {
        type: 'INSIGHT',
        name: 'Top referrers',
        description: '',
        query: {
            kind: 'InsightVizNode',
            source: {
                kind: 'TrendsQuery',
                series: [
                    {
                        kind: 'EventsNode',
                        math: 'unique_session',
                        name: '$pageview',
                        event: '$pageview',
                    },
                ],
                version: 4,
                interval: 'day',
                dateRange: {
                    date_from: '-30d',
                    explicitDate: false,
                    excludeIncompletePeriods: false,
                },
                properties: [],
                trendsFilter: {
                    display: 'ActionsBarValue',
                    showLegend: false,
                    hideWeekends: false,
                    metricSummary: 'total',
                    legendPosition: 'bottom',
                    yAxisScaleType: 'linear',
                    showAnnotations: false,
                    metricShowChange: true,
                    yAxisStartAtZero: true,
                    showMultipleYAxes: false,
                    showValuesOnSeries: false,
                    smoothingIntervals: 1,
                    showPercentStackView: false,
                    stackBreakdownValues: false,
                    aggregationAxisFormat: 'short',
                    resultCustomizationBy: 'value',
                    excludeBoxPlotOutliers: true,
                    metricColorByDirection: false,
                    showAlertThresholdLines: false,
                },
                breakdownFilter: {
                    breakdown: '$entry_referring_domain',
                    breakdown_type: 'session',
                    breakdown_limit: 10,
                    breakdown_hide_other_aggregation: true,
                },
                filterTestAccounts: false,
            },
        },
        layouts: {
            sm: {
                x: 0,
                y: 8,
                w: 6,
                h: 5,
                minW: 2,
                minH: 2,
            },
            xs: {
                x: 0,
                y: 22,
                w: 1,
                h: 5,
                minW: 1,
                minH: 2,
            },
        },
    },
    {
        type: 'INSIGHT',
        name: 'Search engines vs AI',
        description:
            'Sessions that came from a search engine compared with sessions that came from an AI assistant, using the session channel type.',
        query: {
            kind: 'InsightVizNode',
            source: {
                kind: 'TrendsQuery',
                series: [
                    {
                        kind: 'EventsNode',
                        math: 'unique_session',
                        name: '$pageview',
                        event: '$pageview',
                        properties: [
                            {
                                key: '$channel_type',
                                type: 'session',
                                value: ['Organic Search', 'Paid Search'],
                                operator: 'exact',
                            },
                        ],
                        custom_name: 'Search engines',
                    },
                    {
                        kind: 'EventsNode',
                        math: 'unique_session',
                        name: '$pageview',
                        event: '$pageview',
                        properties: [{ key: '$channel_type', type: 'session', value: ['AI'], operator: 'exact' }],
                        custom_name: 'AI assistants',
                    },
                ],
                version: 4,
                interval: 'day',
                dateRange: {
                    date_from: '-30d',
                    explicitDate: false,
                    excludeIncompletePeriods: false,
                },
                properties: [],
                trendsFilter: {
                    display: 'ActionsLineGraph',
                    showLegend: true,
                    hideWeekends: false,
                    metricSummary: 'total',
                    legendPosition: 'bottom',
                    yAxisScaleType: 'linear',
                    showAnnotations: false,
                    metricShowChange: true,
                    yAxisStartAtZero: true,
                    showMultipleYAxes: true,
                    showValuesOnSeries: false,
                    smoothingIntervals: 1,
                    showPercentStackView: false,
                    stackBreakdownValues: false,
                    aggregationAxisFormat: 'numeric',
                    resultCustomizationBy: 'value',
                    excludeBoxPlotOutliers: true,
                    metricColorByDirection: false,
                    showAlertThresholdLines: false,
                },
                filterTestAccounts: false,
            },
        },
        layouts: {
            sm: {
                x: 6,
                y: 8,
                w: 6,
                h: 5,
                minW: 2,
                minH: 2,
            },
            xs: {
                x: 0,
                y: 27,
                w: 1,
                h: 5,
                minW: 1,
                minH: 2,
            },
        },
    },
    {
        type: 'INSIGHT',
        name: 'Website Users by Location',
        description: '',
        query: {
            kind: 'InsightVizNode',
            source: {
                kind: 'TrendsQuery',
                series: [
                    {
                        kind: 'EventsNode',
                        math: 'dau',
                        name: '$pageview',
                        event: '$pageview',
                    },
                ],
                version: 4,
                interval: 'day',
                dateRange: {
                    date_from: '-30d',
                    explicitDate: false,
                },
                properties: [],
                trendsFilter: {
                    display: 'WorldMap',
                    showLegend: false,
                    yAxisScaleType: 'linear',
                    showValuesOnSeries: false,
                    smoothingIntervals: 1,
                    showPercentStackView: false,
                    aggregationAxisFormat: 'numeric',
                    showAlertThresholdLines: false,
                },
                breakdownFilter: {
                    breakdown: '$geoip_country_code',
                    breakdown_type: 'person',
                },
                filterTestAccounts: false,
            },
        },
        layouts: {
            sm: {
                x: 0,
                y: 13,
                w: 12,
                h: 7,
                minW: 2,
                minH: 2,
            },
            xs: {
                x: 0,
                y: 32,
                w: 1,
                h: 7,
                minW: 1,
                minH: 2,
            },
        },
    },
]