jaizendra-netizen / ad-creative-fatigue-check
PHP CLI and library: flag the weeks where an ad creative's click-through rate drops below its own earlier average by more than a threshold you set.
Package info
github.com/jaizendra-netizen/ad-creative-fatigue-check
Type:project
pkg:composer/jaizendra-netizen/ad-creative-fatigue-check
Requires
- php: >=8.1
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-11-30 00:22:49 UTC
README
PHP command line tool and library. Give it a CSV with one row per ad creative per week (impressions and clicks) and it works out the click-through rate for each week, compares each week with the average of that creative's earlier weeks, and flags the weeks where the rate fell by more than a percentage you set. It is a plain calculation on numbers you export from your own ad reports; it does not look anything up. CTR is clicks divided by impressions times 100, printed with 2 decimals, and n/a when a week has no impressions. The earlier average is the simple average of the weekly CTRs of the earlier weeks that had impressions. A week is flagged when its CTR is below that average by more than the drop percent, counted relative to the average (a drop of 1.60 from 2.00 is exactly 20 percent and is not flagged at 20). The drop threshold is set by you: the default of 20 is only a starting value, not a fact about any ad platform. Flagged weeks are a prompt to look at the creative, not a verdict that it is worn out.
Part of the OneGTMLab free GTM tools. Background on the idea: LinkedIn thought leader ads.
Install
composer require jaizendra-netizen/ad-creative-fatigue-check
Use
Input is a CSV with the columns creative, week, impressions and clicks. Column names are matched without regard to case and may be in any order. week is a date written yyyy-mm-dd, any day of that week; a creative may not have the same date twice. impressions and clicks are whole numbers of 0 or more, and clicks may not be more than impressions. Option --drop PERCENT (a number from 0 to 100, default 20, set by you). The command stops at the first bad row and names it. A bad date or number, clicks above impressions, a duplicate week, a missing column, a row with the wrong number of cells, a file with no rows or a bad --drop exits 1 with a message; an unreadable file, an unknown option or a missing argument exits 2.
$ php bin/ad-creative-fatigue-check sample.csv --drop 20
creatives: 3, drop threshold: 20% (set by you)
Ad A: weeks 5, impressions 5000, clicks 85, overall CTR 1.70%, first week CTR 2.00%, last week CTR 1.20%, flagged weeks 2, first flagged week 2026-03-23
flagged 2026-03-23: CTR 1.40% against an earlier average of 1.97% (down 28.8%)
flagged 2026-03-30: CTR 1.20% against an earlier average of 1.83% (down 34.2%)
Ad B: weeks 3, impressions 6000, clicks 90, overall CTR 1.50%, first week CTR 1.50%, last week CTR 1.45%, flagged weeks 0, first flagged week none
Ad C: weeks 3, impressions 1000, clicks 15, overall CTR 1.50%, first week CTR 2.00%, last week CTR 1.00%, flagged weeks 1, first flagged week 2026-03-16
flagged 2026-03-16: CTR 1.00% against an earlier average of 2.00% (down 50.0%)
creatives with at least one flagged week: 2 of 3 (Ad A, Ad C)
Test
php tests/run.php
Offline, no network calls, no dependencies beyond the language runtime. MIT licensed.