- run.py: skip metricas update when campaign has no prior-month
GACampaignMes record instead of silently writing into the new month
- slack_reporter.py: round before formatting so small negative margins
don't render as "-0€"
- analyzer.py: use abs() for tracking discrepancy so both directions alert
- slack_reporter.py: daily table adds L.AT/L.GA/Coste/€.AT/€.GA columns; margin uses Google Ads conversions × PPL; split monthly rankings into separate blocks; fix stale margen field
- run.py: leads_grupo always uses Google Ads conversions; tracking alert shows direction (over/under attribution)
- agent.py: increase decide() max_tokens 700→750 to fix JSON truncation for long campaign names
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- airtable_client: restrict leadform cursoid path (path 5) to PMX-only
campaigns, preventing triple-attribution to search+pmx+leadform companion
- slack_reporter: derive margen from ingreso-coste instead of stale MetricasDiarias
field; split monthly rankings from fields to separate section blocks; add
_trunc() helper to clamp all text blocks under Slack's 3000-char limit
- agent: increase portfolio_daily_analysis max_tokens 500→800
- backfill: extend to June 11
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both the monthly summary and the daily table now derive coste
from MetricasDiarias entries, so totals match exactly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- GAMes: new Airtable table aggregating daily fco_ metrics (coste, ingreso_sum, ingreso_lxp, leads, leads_lake)
- run.py: accumulate fco_ daily aggregate and write to GAMes each run
- slack_reporter.py: replace sparkline with daily margin % table (Sumatorio + LeadsxPPL per day)
- backfill_games_mayo.py: populated GAMes with all 17 existing May days
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Use CosteMes and ConvMes from all previous month fco_ campaigns (not just
those active in current month) to avoid missing paused campaigns
- Show day-1 cierre block with Google Ads data labeled explicitly
- Show current month as 0 on day 1 (no data yet)
- Fetch Campaign Name in get_metricas_diarias_prev_month for fco_ filtering
- Fetch prev month data for days 1-5 (last 5 days can span two months)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- New slack_reporter.py: posts daily summary to Slack after each run
- Shows monthly investment, revenue (sumatorio + leadsxPPL) and margins
- Rankings of best/worst fco_ campaigns for last 5 days and current month
- Alerts for campaigns with losses > 200€ or margin < -50%
- MetricasDiarias uses yesterday's data (Google Ads lag)
- SLACK_WEBHOOK_URL added to config
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>