Let an agent test ad variants for a newsletter within a fixed budget
Idea + starter prompt, not run by us yet
For: Newsletter owners and small advertisers who want to test ads on a tight cap
A Claude Code agent got a fixed budget and a Meta Ads account for the author's newsletter. Each morning one command started it: it reviewed its own logs, pulled ad and analytics data, chose to create, pause or scale ads, and wrote its reasoning to git. Over 31 days it tested about 50 variants and got 243 leads at a higher cost than the target. His single manual change made costs jump.
Steps
- Set a hard total budget and a daily cap in the ad account itself, not just in the prompt.
- Give a clear goal that includes lead quality from day one. The agent ignored quality until day 16.
- Do not tell it the experiment ends at day 30. That made it play safe, so describe the goal as ongoing.
- Ask it to log its reasoning for every change. Read the log each morning.
- Avoid editing the funnel in the middle of a test. His form change hurt results.
Starter prompt
Trial first: use a synthetic results export, [synthetic-results.csv], with invented ad names, spend and leads. Run the whole daily review on that. Make no account changes and spend no money during the trial. Help me run a small test of Meta ads for my newsletter [name]. Total budget [amount], daily cap [amount], target cost per lead [amount]. A good lead is [definition, e.g. a real email that opens the welcome email]. Each morning I will ask you to read yesterday's results and propose actions: create, pause or scale ads. Log your reasoning each day. Treat this as ongoing and not a one-month trial. Stop and wait for my yes on each proposed live action, separately. Approving one is not approval of the next. Never spend beyond the caps. Do not ask me for card numbers or passwords.
Original post: technically.dev · found via agentusecases.ai. Written up in our own words. We haven't run it, so test it on made-up data first.