Open docs/sample-output/daily-check-sample-report.html first.
This project turns a LinkedIn campaign export into a daily account-health check for an Ads specialist. One command refreshes the report, calculates the required KPIs, checks budget pacing against a configurable monthly budget, and ranks the campaigns that need manual review first.
- Are CPC, CTR, CPL, and conversion rate on target today?
- Is month-to-date spend pacing correctly against budget?
- Which campaigns should the specialist inspect first, and why?
- What artifact can be saved or shared after each daily review?
- turns a raw campaign export into a readable account-health report
- separates deterministic KPI scoring from the optional analyst note
- produces HTML, JSON, and Markdown artifacts from one local command
- prioritizes review work instead of only displaying metric tables
- keeps the default demo reproducible through the committed fixture
The tool writes three runtime artifacts on every run:
output/latest_report.html: shareable HTML reportoutput/latest_report.json: machine-readable snapshot of the scoring logic and outputsoutput/latest_summary.md: copy-paste summary for email, Slack, or notes
The output/ directory is treated as generated runtime state and is not part of the committed public repo surface. A curated sample report lives under docs/sample-output/.
The intended user already works from a spreadsheet and LinkedIn Campaign Manager. A single-file HTML report keeps that workflow simple:
- no deployment required
- one rerun command
- one visual report to review
- one JSON snapshot to archive or automate later
- Open docs/sample-output/daily-check-sample-report.html.
- Check the top KPI cards and pacing status.
- Read the deterministic
Today's action list. - Scroll to
Campaigns to review firstto see exactly why campaigns were prioritized. - If needed, rerun the script locally to produce fresh
output/latest_*artifacts.
- Open docs/sample-output/daily-check-sample-report.html and frame it as the replacement for manually scanning the spreadsheet every morning.
- Show the latest-date and month-to-date KPI snapshots.
- Point to the pacing section to explain whether the account is under, on, or over pace.
- Read one or two lines from
Today's action listto show the report is action-oriented, not just a metric dump. - Scroll to
Campaigns to review firstand show that every prioritized row includes the reason it was flagged. - Close by showing that rerunning the script refreshes the local HTML, JSON, and Markdown outputs under
output/.
Default deterministic path against the shipped sample fixture:
python .\linkedin_ads_monitor.py --config .\config.example.jsonEquivalent direct fixture path:
python .\linkedin_ads_monitor.py --csv-path .\fixtures\sample_linkedin_ads.csv --monthly-budget 1000Bring-your-own export path:
python .\linkedin_ads_monitor.py --csv-url https://example.com/your-export.csv --monthly-budget 1000Automated verification:
python -m unittest discover -s .\tests -vCampaign ranking is rule-based and deterministic. A campaign is pushed toward the top of the review list when it breaches KPI thresholds or signals wasted spend, for example:
- CPC above target
- CTR below target
- lead-gen spend without leads
- traffic spend without conversions
- spend with no clicks
The Best campaigns on latest day table excludes anything already flagged for review so the report does not tell the specialist to both fix and scale the same campaign.
At runtime, AI is optional:
- If enabled and an API key is present, it can generate the
Analyst note. - If no API key is present, the tool falls back to deterministic rule-based notes.
- No API key is required to review the committed sample report or run the deterministic local demo.
AI does not calculate KPIs, pacing, or campaign ranking. Those remain deterministic in all modes.
To enable the optional live AI note:
- Set
OPENAI_API_KEY - Change
"enabled": truein config.example.json or pass--enable-ai-summary - Rerun the script
Prerequisites:
- Python 3.10+
- Internet access only if you use a remote CSV export URL
No third-party Python packages are required for the base version.
- The committed fixture is the default demo source for reproducible local runs.
- A live CSV export can be supplied explicitly through
--csv-urlor a local config file. - Monthly budget is a user input because the source data does not include it.
- Campaign names are accepted in the 7-part and 8-part formats present in the sample export.
- Conversion rate is calculated as
Conversions / Clicks. - CPL is calculated as
Total spent / Leads; if no leads exist, CPL is shown asN/A. - This v1 does not connect back to LinkedIn, edit campaigns, or automate budget changes.
- LICENSE
- SECURITY.md
- CI runs the deterministic unittest suite on every push and pull request.
