Last month I needed to launch a Facebook ad campaign for a niche product, but writing dozens of variations ate up my mornings. I stared at a blank screen, tried a few generic prompts, and got copy that sounded like every other ad out there. The frustration was real, and I knew there had to be a faster way.
After a few failed attempts I built a simple pipeline that takes a product description, spits out platform‑specific ad copy, logs performance, and lets me iterate without touching a keyboard. By the end of this guide you’ll have a working system you can run today, plus the option to grab a pre‑built blueprint if you’d rather skip the setup.
Why does my AI ad copy keep getting flagged by platforms?
One of the first things I noticed was that the AI kept producing lines that triggered Facebook’s policy checks — phrases like “best ever” or “guaranteed results” got the ad rejected. The model wasn’t aware of the rules; it was just trying to be persuasive. I solved this by adding a rule‑based filter step that scans the output for a blacklist of forbidden terms and sends the copy back for a rewrite.
Here’s the exact prompt I use for the copy generator (you can swap the model for Claude or GPT‑4o):
You are an expert direct‑response copywriter. Write three ad variations for a Facebook newsfeed ad. Each variation must be under 125 characters, include a clear call‑to‑action, and avoid any of the following words: best, ever, guaranteed, miracle, secret, free, risk‑free. Product: {{product_desc}}. Tone: bold but honest.
The curly braces are placeholders that my automation fills in from a Google Sheet. The blacklist lives in a simple JSON file that the filter step reads.
What most guides get wrong
Most tutorials tell you to chain a prompt directly to an API call and call it a day. They skip the validation layer, assume the model will obey platform rules, and ignore the need for versioning. The result is a flood of rejected ads, wasted spend, and a lot of manual rework. In my experience the missing piece is a lightweight feedback loop that catches policy violations before they reach the ad account.
Another common mistake is treating every platform the same. A headline that works on Google Search often fails on TikTok because the character limits and audience expectations differ. I solved this by storing a platform‑specific template in a YAML file and letting the automation pick the right one based on the target channel.
How to debug when this breaks
When the pipeline stops producing copy, I first check the logs of the API call. If I see a 429 error, I know I’ve hit the rate limit and need to add a retry with exponential backoff. If the output is empty, the prompt likely got malformed — I verify that the placeholders were replaced correctly by printing the final prompt to a debug file.
If the filter keeps rejecting everything, I open the blacklist and see if I’ve added something too broad. A single stray word like “free” can nuke an entire batch. I then adjust the list, run a quick test with a known‑good product description, and move on.
