diff --git a/src/app/dashboard/kpis/page.tsx b/src/app/dashboard/kpis/page.tsx index 3fadfa0..e42561b 100644 --- a/src/app/dashboard/kpis/page.tsx +++ b/src/app/dashboard/kpis/page.tsx @@ -20,8 +20,11 @@ import { isAgencyRole, serviceHeaders, supabaseUrl, userRole } from '@/lib/agenc export const dynamic = 'force-dynamic'; -/** Enough history for YoY on ad-level Meta rows (can be dense). */ -const AD_DAILY_LOOKBACK_DAYS = 420; +/** Enough history for YoY from Jan 2025 (inclusive). */ +const AD_DAILY_LOOKBACK_DAYS = Math.max( + 700, + Math.ceil((Date.now() - Date.UTC(2025, 0, 1)) / 86400000) + 14 +); const AD_DAILY_PAGE = 1000; async function fetchAdDaily(