- Sync shows campaign ID, name and status for new campaigns,
and field-level changes (before/after) for updated ones
- Agent now returns a 'consejo' field with a specific actionable
recommendation per campaign
- Summary table includes leads, margin and consejo per campaign
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Force UTF-8 stdout with line buffering to fix Windows encoding error
- Use batch_create/batch_update in Airtable sync (10x faster)
- Fix CampaignID field type (string, not int)
- Fix FechaEntrada → Fecha in leads query
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Campaigns: Status='Activa' filter (was Activa=TRUE), CPAMax (was
CPAMaximo), add MargenObjetivo and CursoID Text per campaign
- Leads: filter by attr_cursoid + creado (was GoogleCampaignID + Fecha)
- analyzer: expose margen_objetivo and margen_ok per campaign
- config: remove global MARGEN_MINIMO, now per-campaign via Airtable
- sync: new campaigns created with Status='Pausada'
https://claude.ai/code/session_01WEcdWPxGWZKk8FGwBRLGR2
Before each run, fetch all non-removed campaigns from Google Ads
and upsert them into the Airtable campaigns table: new campaigns
are created (Activa=False, pending manual PPL/Cap/CPA setup) and
existing ones get their name updated if it changed.
https://claude.ai/code/session_01WEcdWPxGWZKk8FGwBRLGR2