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.

1.1 KB
Raw Blame
import { IconClock } from '@posthog/icons'

import { TZLabel } from 'lib/components/TZLabel'
import { LemonTag } from 'lib/lemon-ui/LemonTag'
import { Tooltip } from 'lib/lemon-ui/Tooltip'

export function MarketingAnalyticsFreshness({
    latestDayComputedAt,
}: {
    latestDayComputedAt: string | null
}): JSX.Element | null {
    if (!latestDayComputedAt) {
        return null
    }

    return (
        <Tooltip
            title={
                <div className="flex flex-col gap-1">
                    <span>The numbers for the most recent day in this range were computed at this time or later.</span>
                    <span>Ad spend also depends on when your data warehouse source last synced.</span>
                    <TZLabel time={latestDayComputedAt} timestampStyle="absolute" showPopover={false} />
                </div>
            }
        >
            <LemonTag type="muted" icon={<IconClock />} data-attr="marketing-analytics-freshness">
                <span>Computed&nbsp;</span>
                <TZLabel time={latestDayComputedAt} showPopover={false} noStyles />
            </LemonTag>
        </Tooltip>
    )
}