How to Run Facebook & Instagram Ads with Your Codex AI Agent [2026]
Adspirer Team
This is Part 3 of the AI marketing agent series. Your Codex agent is installed and your brand workspace is created. Now we build a Meta Ads specialist — teaching the agent your creative strategy, your audience insights, and your campaign patterns so it can monitor Facebook and Instagram ads autonomously and help you launch new campaigns grounded in what’s already working.
In Part 1, we covered why AI marketing agents are different from assistants. In Part 2, we installed Codex, connected your ad accounts, and created the brand workspace. Now comes the interesting part: making the agent genuinely useful for Meta Ads specifically.
A general-purpose agent connected to your ad accounts can pull performance data and create campaigns. But a Meta Ads specialist agent understands your creative strategy, knows which audiences convert for your business, monitors creative fatigue autonomously, and generates campaign ideas based on patterns it’s learned from your data.
The difference is knowledge. And knowledge comes from using the agent deliberately — feeding it findings, confirming discoveries, and building up STRATEGY.md with Meta-specific directives over time.
This is Part 3 of a 3-part series.
- Part 1: How to Build an AI Marketing Agent for Paid Media
- Part 2: How to Set Up Your AI Marketing Agent with Codex
- Part 3 (this post): Building a Meta Ads specialist agent
Teaching Your Agent About Meta Ads
Your agent’s AGENTS.md already has a performance snapshot from setup. But a snapshot isn’t expertise. Expertise comes from understanding why certain campaigns perform — which creative formats work for your audience, which targeting combinations convert, which placements deliver the best CPA.
Let’s build that understanding.
Step 1: Deep Performance Analysis
Start by asking the agent to go beyond surface metrics and find the patterns:
This analysis uses Adspirer’s get_meta_campaign_performance, analyze_meta_ad_performance, analyze_meta_audiences, and detect_meta_creative_fatigue tools — all running through the same MCP connection. See the full Meta Ads tool reference for what’s available.
Step 2: Save the Findings to STRATEGY.md
When the agent presents its findings, you’ll see patterns emerge. Maybe video ads have 40% lower CPA than static images. Maybe women 25-34 convert at 3x the rate of other demographics. Maybe your creatives fatigue after 12 days on average.
These findings need to be saved so the agent remembers them across sessions:
Now every future session — every campaign creation, every performance review, every ad copy generation — is filtered through these directives. The agent doesn’t need to re-analyze to know that video works better for you. It’s in the strategy file.
Autonomous Creative Fatigue Monitoring
Creative fatigue is the biggest silent budget killer in Meta Ads. Ads lose effectiveness gradually — CTR drops 2-3% per day, CPA creeps up — and by the time you notice in Ads Manager, you’ve overspent on tired creative for a week or more.
This is the perfect use case for an autonomous agent. It monitors continuously, catches fatigue early, and alerts you before the damage compounds.
Configure the Monitor
Add a Meta-specific autonomous workflow to your agent. Create or edit your agent config:
[agent.meta_creative_monitor]schedule = "0 8 * * *" # Every day at 8amprompt = """Check my Meta Ads for creative fatigue. For each active ad:1. Compare this week's CTR to the first week's CTR2. Check if frequency exceeds the threshold in STRATEGY.md3. Check if CPA has increased more than 25% vs first-week baseline
For any fatigued ads:- Show current metrics vs first-week metrics- Calculate how much I'm overspending per day (current CPA - first-week CPA × daily conversions)- Recommend: refresh creative, pause and replace, or rotate to a new variation
Save any new fatigue patterns to STRATEGY.md (e.g., "carousel ads fatigue faster than video for this brand")."""What the Agent Catches
A typical alert looks like this:
⚠️ Creative Fatigue Alert — March 30, 2026
2 ads showing fatigue:
1. "Spring Collection - Carousel" (Campaign: Retargeting) First week: CTR 3.2%, CPA $7.50, Frequency 1.4 This week: CTR 1.8%, CPA $12.30, Frequency 3.8 Decline: CTR -44%, CPA +64% Daily overspend: ~$14.40 (based on 3 conversions/day) → RECOMMEND: Pause and replace. Carousel has run 21 days.
2. "Product Demo - Video" (Campaign: Prospecting) First week: CTR 2.8%, CPA $9.20, Frequency 1.2 This week: CTR 2.1%, CPA $11.50, Frequency 2.6 Decline: CTR -25%, CPA +25% Daily overspend: ~$6.90 → RECOMMEND: Refresh creative (same script, new visuals). Video still performing above average — hasn't fully fatigued.
📝 New pattern saved to STRATEGY.md:"Carousel ads fatigue after ~14 days for retargeting audiences (3 data points).Video ads last ~21 days for cold prospecting (2 data points)."Notice the last part — the agent saves new patterns to STRATEGY.md. Over time, your fatigue thresholds become brand-specific, not generic industry averages.
Building a Campaign Ideation Pipeline
Great campaign ideas don’t come from nowhere. They come from understanding what’s already working and finding new angles to expand on it. Your agent has all the data to do this analysis — it just needs the right prompts.
Mine Winners for Expansion
Research New Audiences
Before launching a new campaign, the agent can search Meta’s targeting taxonomy for audiences that match your ideal customer:
This uses Adspirer’s search_meta_targeting and browse_meta_targeting tools to search Meta’s actual targeting options — not generic advice. For the full list of targeting tools, see the Meta Ads documentation.
Cross-Platform Audience Intelligence
If you’re running Google Ads alongside Meta, your search term data is a goldmine for Meta campaign ideas. Keywords people search for tell you exactly what they want — and that intent maps directly to Meta targeting:
This cross-platform intelligence is something no single ad platform can provide. Your agent sees all your data across all platforms through Adspirer’s unified MCP connection. See the platform comparison guide for more on cross-platform capabilities.
Campaign Creation with Brand Context
When your agent creates a Meta campaign, it’s not starting from zero. It reads AGENTS.md (brand voice, audiences, guidelines), checks STRATEGY.md (what works, what to avoid), and follows the 6-step workflow enforced by the Ad Campaign Management skill.
The Informed Creation Flow
Notice the difference from a generic “create a Meta campaign” prompt. The agent uses your accumulated knowledge — brand voice, winning audiences, proven placements, messaging patterns — all automatically because it’s in AGENTS.md and STRATEGY.md.
Creative Requirements
Your campaign will fail validation if the creative doesn’t meet Meta’s specifications:
| Format | Minimum Size | File Types | Max Size | Aspect Ratios |
|---|---|---|---|---|
| Image | 1080x1080px | JPG, PNG | 30MB | 1:1 or 4:5 |
| Video | 1080x1080px | MP4, MOV | 4GB | 1:1, 4:5, or 9:16 |
| Carousel | 1080x1080px per card | JPG, PNG | 30MB/card | 1:1 |
Adspirer can’t access private links. Use publicly accessible URLs from Google Drive (set to “Anyone with the link”), Dropbox, S3, or any direct URL. The agent validates dimensions, format, and accessibility before attempting to create the campaign.
Instagram-Specific Workflows
Instagram ads are managed through the same Meta Ads system — when you connect Meta Ads, you get Instagram automatically. The difference is in placement strategy:
- Feed (1:1 or 4:5): Best for product images, carousels, considered purchases
- Stories (9:16): Best for limited-time offers, flash sales, urgent CTAs
- Reels (9:16): Best for brand awareness and discovery — content that feels native outperforms obvious ads dramatically
- Explore: Best for cold audience prospecting — reaching people outside your followers
Building Brand Voice for Ad Copy
One of the most powerful aspects of the agent system is brand-consistent ad copy generation. Instead of writing copy from scratch every time, the agent learns what messaging works for your brand.
Establish Your Copy Patterns
Once saved, every future ad copy generation follows these patterns:
This uses the $adspirer-write-ad-copy skill, which reads your brand context and strategy before generating anything. See the skill reference for details.
The Full Autonomous Cycle
Here’s what a fully configured Meta Ads agent cycle looks like once all the pieces are in place:
Daily: Creative Fatigue Monitor (8am)
Agent checks all active Meta ads for CTR decline, frequency spikes, and CPA increases. Alerts you with specific recommendations. Saves new fatigue patterns to STRATEGY.md.
Weekly: Performance Scorecard (Monday 9am)
Agent runs $adspirer-performance-review for Meta Ads. Compares against KPI targets in AGENTS.md. Identifies strategy drift vs. STRATEGY.md directives. Gives you a prioritized action list.
Bi-Weekly: Wasted Spend Audit (1st and 15th)
Agent runs $adspirer-wasted-spend for Meta Ads. Finds ad sets spending without converting, audiences with declining ROI, placements underperforming. Estimates monthly savings.
Monthly: Strategy Review and Refresh (1st of month)
Agent re-runs the deep analysis from Step 1 of this guide. Compares month-over-month trends. Updates STRATEGY.md with new findings. Refreshes AGENTS.md performance snapshot. Recommends budget reallocation.
On Demand: Campaign Creation
When you’re ready to launch something new, the agent creates campaigns informed by everything it’s learned — audiences that convert, creative formats that last, copy patterns that perform, budget levels that work.
The Compounding Effect: Month 1 vs Month 6
Month 1
- STRATEGY.md is mostly empty
- The agent creates campaigns based on your instructions and general best practices
- Creative fatigue detection uses industry-standard thresholds (frequency > 3, CTR decline > 20%)
- Campaign suggestions are generic — “test these interest audiences”
Month 3
- STRATEGY.md has 15-20 directives based on real data
- The agent knows that video ads last 21 days for your brand while carousels fatigue at 14
- Audience targeting uses proven demographics (women 25-34 at 3x conversion rate)
- Copy generation follows your brand’s proven headline structures and CTA patterns
- Budget allocation is informed by 3 months of cross-platform ROI data
Month 6
- STRATEGY.md is a comprehensive playbook — 40+ directives covering targeting, creative, copy, budget, and placement strategy
- The agent is effectively a junior media buyer trained specifically on your brand
- New team members can read AGENTS.md and STRATEGY.md to understand your entire advertising strategy in 10 minutes
- Campaign creation quality is significantly higher because every decision is informed by 6 months of accumulated learning
- Fatigue thresholds, audience preferences, and copy patterns are all brand-specific, not generic
This is the advertising brain we described in Part 1. Not artificial general intelligence. A system that remembers what works, follows your strategy, catches problems early, and compounds knowledge over time.
FAQ
Conclusion
Building a Meta Ads specialist agent isn’t a one-time setup — it’s an ongoing process of teaching the agent what works for your brand. The setup takes 10 minutes. The value compounds over months.
Start with the deep performance analysis to understand your current patterns. Save the strong findings to STRATEGY.md. Configure autonomous creative fatigue monitoring. Use the campaign ideation pipeline to turn data into new campaign ideas. And let the agent build your brand’s advertising knowledge base over time.
The agents that perform best aren’t the ones with the most sophisticated prompts. They’re the ones with the most accumulated knowledge — months of strategic decisions, creative patterns, audience insights, and performance benchmarks, all saved in files that persist across every session.
Ready to build your Meta Ads agent? Start with Part 1 if you haven’t read it yet, then Part 2 for installation. Adspirer is free to start with 15 tool calls/month.
Related Articles
- How to Build an AI Marketing Agent for Paid Media — Part 1: The concept
- How to Set Up Your AI Marketing Agent with Codex — Part 2: Installation and setup
- How to Run Facebook & Instagram Ads with ChatGPT — The assistant approach to Meta Ads
- How to Run Facebook & Instagram Ads with Claude AI — Claude’s reasoning for Meta Ads
- The Death of the Dashboard — Why agents are replacing dashboards
- Best AI Tools for PPC Managers — Complete AI tools landscape
More articles to read
How to Run Facebook & Instagram Ads with Your Claude Code AI Agent
Build a Meta Ads specialist with Claude Code: creative fatigue monitoring, audience optimization, campaign ideation with web research, and compounding knowledge across sessions.
How to Set Up Your AI Marketing Agent with Claude Code [2026]
Install the Adspirer plugin, create your brand workspace, configure sub-agents, and run your first ad performance check — all from the Claude Code CLI.