Case study · Reporting

The weekly marketing report builds itself

One script reads eight channels every Monday morning and writes the deck leadership opens. It runs on a schedule, and it still finishes when a channel is down.

PythonCRM, ads, search, socialAutomated deckTrend history
8channels in one report
4file types built per run
0hours of manual assembly
Weeklyon a cron, no one presses go

Problem

Reporting ate a day and told leadership nothing.

The old version was a person opening seven tabs, copying numbers into slides, and writing a summary on Friday afternoon. It took most of a day. By the time it was read, some of it was a week old.

Worse, it was an activity log. It said what marketing did. It did not say what changed or what was at risk.

What the script does

Reads eight sources

CRM pipeline, two ad platforms, search performance, published content, social, prospecting, and PR. Each one is a small function that returns the same shape.

Compares to last week

Every headline number carries a week-on-week change, coloured by direction. It knows that a lower search position is good, so it does not paint a win red.

Keeps a history file

Each run appends one row per week to a CSV. That file is what makes the trend lines possible, and it survives across machines because it is in the repo.

Writes the summary

A model reads the week's numbers and writes four or five lines: what moved, the cross-channel story, and the biggest risk. If the model call fails, the script falls back to one plain line per channel and still finishes.

The design rule

A broken channel must not break the report.

Every source can fail. An API changes, a token expires, an account gets locked. If any one of those stops the report, the report stops being weekly, and then it stops existing.

So each source degrades on its own. If it fails, that section prints a short note saying what is missing and the rest of the report builds as normal. Stale data is handled the same way: if a cached file is older than the reporting window, the section says so and contributes nothing to the headline numbers. A stale number never reaches the scorecard.

The report goes out as an editable deck, a PDF, a web page, and Markdown. The deck matters most. Leadership retypes lines and leaves comments in it, which they cannot do with a picture of a chart.

What it proves

You can own numbers you did not collect.

Owning the email channel means reporting on pipeline, not opens. That means reading the CRM, joining sends to deals, and being willing to publish the number when it is bad. The reporting has to be automatic for that to happen every week rather than in the weeks the number looks good.

Figures, spend, pipeline, and account identifiers are withheld. The architecture is the transferable part.