From a13ddcb46c96154f304065d1db3203d3bc08291b Mon Sep 17 00:00:00 2001 From: Christian Vidal Wolf Date: Mon, 11 May 2026 15:06:41 +0200 Subject: [PATCH] debug: console logs for ad spend diff --- App.tsx | 2 +- components/Dashboard.tsx | 6 +++--- components/DataGrid.tsx | 17 +++++++++++------ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/App.tsx b/App.tsx index 0b5db49..7400cf2 100644 --- a/App.tsx +++ b/App.tsx @@ -854,7 +854,7 @@ const App: React.FC = () => { = ({ } const t = yearMap.get(y)!; - if (t.cost === 0 && ad.cost > 0) { - console.log("DASHBOARD AD RECORD:", ad); + if (ad.year === 2026) { + console.log("DASH 2026 W" + ad.week, ad.cost); } t.cost += ad.cost || 0; - t.attributedSales += ad.attributedSales30d || ad.salesAds || 0; + t.attributedSales += ad.attributedSales30d; t.clicks += ad.clicks || 0; t.impressions += ad.impressions || 0; }); diff --git a/components/DataGrid.tsx b/components/DataGrid.tsx index d738421..91b2fa7 100644 --- a/components/DataGrid.tsx +++ b/components/DataGrid.tsx @@ -272,12 +272,17 @@ const DataGrid: React.FC = ({ data, filters, hasCustomerFilter, a const adsSummary = useMemo(() => { if (!adsData || adsData.length === 0) return null; - const totals = adsData.reduce((acc, ad) => ({ - cost: acc.cost + ad.cost, - attributedSales: acc.attributedSales + ad.attributedSales30d, - clicks: acc.clicks + ad.clicks, - impressions: acc.impressions + ad.impressions, - }), { cost: 0, attributedSales: 0, clicks: 0, impressions: 0 }); + const totals = adsData.reduce((acc, ad) => { + if (ad.year === 2026) { + console.log("GRID 2026 W" + ad.week, ad.cost); + } + return { + cost: acc.cost + ad.cost, + attributedSales: acc.attributedSales + ad.attributedSales30d, + clicks: acc.clicks + ad.clicks, + impressions: acc.impressions + ad.impressions, + }; + }, { cost: 0, attributedSales: 0, clicks: 0, impressions: 0 }); return { totalSpend: totals.cost,