Insights

Automate marketing reporting with Codex

Create repeatable export processing before asking a model to write the commentary.

The key idea

Codex is a coding work environment, not another name for a writing model. Use it to develop and test preparation or validation scripts, then give validated results to a model for explanation.

Developer working with two monitors and reporting documents

The starting point

  • Two representative anonymised exports, including missing data
  • A dictionary of columns, currencies, dates and calculation rules
  • A manually calculated reference for a small sample

1. Define a data contract

Specify required columns and types, row granularity, duplicate keys and date rules. Have the program clearly reject incompatible files. Missing values should not silently become zero: define a documented rule for each field.

2. Develop the script and checks

Ask Codex for reading, validation, aggregation, calculation and export in your approved environment. Disallow unnecessary network access and source-file modification. Supply reference results and error cases. Review the code and run tests before recurring use.

3. Add commentary

Give GPT or Claude the validated tables and business context. If evaluating DeepSeek via API, test the same format, quality and data conditions. The model describes observations; it does not reinvent totals or silently repair rejected input.

4. Plan operation

Keep execution logs, script versions and input identifiers. Define handling for changed exports or unavailable services. Schedule only with an owner, duplicate protection and a stop mechanism. Document manual recovery.

A practical example

Build a reporting script from the attached schema and examples. Do not modify source files or access the network. Validate columns, types, dates and duplicates. Aggregate counts before calculating ratios; represent zero denominators as not calculable. Provide a results export, validation log and tests for valid input, missing columns, duplicates and invalid values. Compare against the small reference sample before considering it ready.
Test caseExpected behaviourReason
Missing cost columnExplicit failurePrevent misleading reports
Duplicate rowFlag using defined keyPrevent double counting
Zero conversionsCPA not calculableAvoid a false zero
Source exportFile unchangedSupport audit and recovery

How to assess progress

  • A script that runs is not necessarily correct.
  • Never put secrets or private data in a public repository.
  • Assign maintenance and account for export-format changes.

Official sources

OpenAI · CodexDeepSeek · API documentation

Find the campaign hidden by the average

A synthetic CSV covers four campaigns across two periods. The question: does improving overall return hide a problem?

Reproduce the reporting demo

Run the linked demo with Python 3.9+. Expected: €6,000 baseline spend; €34,880 comparison revenue; 436 comparison conversions. The valid file must exit with code 0; the invalid file with code 2. These are synthetic cross-channel data, not a native Google Ads export or a model benchmark. Map real export columns and approve conversion definitions before adapting it.

python3 analyze.py campaigns.csv
python3 analyze.py invalid-campaigns.csv
View details

These demonstrations use fictional briefs, documents and synthetic data. They are examples of method, not client results.

MindVerve

Want this workflow built for your team?

AI Workflow Launch can cover one documented reporting workflow, from export to decision brief. MindVerve scopes calculations, validation, model selection and team handover; integrations are specified in the quote.

Discuss my AI workflowFive areas. One coherent direction.