From f19a54ca423541ca698a74d16e964c7a942f3a74 Mon Sep 17 00:00:00 2001
From: 4Ventures <4ventures@MacBook-Air-de-4Ventures.local>
Date: Tue, 6 Oct 2026 12:53:20 +0200
Subject: [PATCH] Drop the Google Ads campaign table from the metrics
scorecard.
Co-authored-by: Cursor
---
src/components/MetricsDashboard.tsx | 88 -----------------------------
1 file changed, 88 deletions(-)
diff --git a/src/components/MetricsDashboard.tsx b/src/components/MetricsDashboard.tsx
index fd0e027..583eb99 100644
--- a/src/components/MetricsDashboard.tsx
+++ b/src/components/MetricsDashboard.tsx
@@ -431,42 +431,6 @@ export default function MetricsDashboard({
return 'CRM';
}, [integrations]);
- const googleCampaigns = useMemo(() => {
- const byCampaign = new Map<
- string,
- { spend: number; impressions: number; clicks: number; leads: number }
- >();
- for (const r of rangedDaily) {
- if (r.platform !== 'google') continue;
- const name = r.campaign_name || r.campaign || 'Campaña sin nombre';
- const cur = byCampaign.get(name) || {
- spend: 0,
- impressions: 0,
- clicks: 0,
- leads: 0,
- };
- cur.spend += Number(r.spend) || 0;
- cur.impressions += Number(r.impressions) || 0;
- cur.clicks += Number(r.clicks) || 0;
- cur.leads += Number(r.platform_leads ?? r.conversions) || 0;
- byCampaign.set(name, cur);
- }
- const totalSpend = [...byCampaign.values()].reduce((a, b) => a + b.spend, 0);
- return [...byCampaign.entries()]
- .map(([name, v]) => ({
- name,
- ...v,
- cpl: v.leads > 0 ? v.spend / v.leads : 0,
- share: totalSpend > 0 ? (v.spend / totalSpend) * 100 : 0,
- kind: /pmax|performance/i.test(name)
- ? 'Performance Max'
- : /search|brand/i.test(name)
- ? 'Búsqueda'
- : 'Otra red',
- }))
- .sort((a, b) => b.spend - a.spend);
- }, [rangedDaily]);
-
const adsCards = cards.filter((c) =>
['spend', 'leads', 'cpl'].includes(c.key)
);
@@ -947,58 +911,6 @@ export default function MetricsDashboard({
- {googleCampaigns.length > 0 && (
-
-
-
- 5. Campañas Google Ads
-
-
- Desglose de la inversión Google del periodo. Meta va en Ads /
- creatividades. No vuelve a contar el scorecard de arriba.
-
-
-
-
-
-
- | Campaña |
- Red |
- Inversión |
- Clics |
- Conv. |
- CPL |
-
-
-
- {googleCampaigns.slice(0, 12).map((c) => (
-
- |
- {c.name}
- |
- {c.kind} |
- {formatEur(c.spend)} |
- {formatNum(c.clicks)} |
- {formatNum(c.leads)} |
-
- {c.cpl > 0 ? `${formatNum(c.cpl)} €` : '—'}
- |
-
- ))}
-
-
-
- {googleCampaigns.length > 12 && (
-
- Mostrando 12 de {googleCampaigns.length} campañas (las de más
- gasto). El resto está en Ads.
-
- )}
-
- )}
);
}