2 Commits

Author SHA1 Message Date
deed1db80e Add deep creative analysis: standalone script, dashboard tab, compact Slack scorecard
- analyze_creatives.py: nuevo script independiente que analiza visualmente todos los
  anuncios activos, detecta fatiga creativa (CTR 3d vs 7d) y compara creatividades
  dentro del mismo adset usando Claude Sonnet con visión
- agent.py: analyze_creative_deep() con métricas de rendimiento + detección de fatiga,
  compare_adset_creatives() para comparativa multi-imagen, fallback de descarga de
  imágenes por lista de URLs, prompts en español
- meta_ads_client.py: get_ads_with_creatives() incluye adset_id, image_url separado de
  thumbnail_url, y video_thumbnail_url via AdVideo.picture para vídeos
- baserow_client.py: get_all_creative_analyses() y get_creative_history_by_ad()
- dashboard.py: nueva pestaña Creatividades con tabla seleccionable, panel lateral con
  thumbnail + análisis + recomendaciones + gráfico de evolución del score
- slack_notifier.py: scorecard compacto (una línea por anuncio con acción breve),
  fix del límite de 50 bloques via flush proactivo antes de cada adset

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-19 12:03:10 +02:00
8fb0b69896 Add Baserow persistence, Slack interactive reports, Streamlit dashboard, and full analysis pipeline
- Migrate from Airtable to Baserow: BaserowClient with snapshots, actions, creatives, logs
- Claude agents (Haiku for decisions/units, Sonnet for creatives) with cost_cap_eur vs CPL comparison
- Slack bot with colored action emojis, effect text before approval buttons, 500-char justifications
- Streamlit dashboard with date-range navigation, campaign drill-down (adsets/ads), Histórico tab
- Approval server (FastAPI + ngrok) for Slack button callbacks
- backfill.py for historical snapshot regeneration with Claude re-analysis
- Margin fix: 0-lead campaigns contribute -spend (not 0) to margin
- CTR fix: Meta returns CTR as percentage already, removed *100
- Parameter fix: pass decision parameter to Slack action for correct budget effect display

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 09:30:13 +02:00