PROMPTS · PAID MEDIA

How to run paid media with AI

The five prompts I use to run Meta Ads and Google Ads from a coding agent: connect the platforms, send every conversion back to them, create the campaigns, then optimize every day. Paste them in order into Claude Code or any coding agent, inside the repository of your product.

01 / THE METHOD

STEPS

4 STEPS
  1. Connect tools. Link your coding agent to Meta Ads, Google Ads or any other ad platform.

  2. Conversion engineering. Map your funnel, define the conversion events, store the click ID with the user, and send every conversion back to the platform.

  3. Create campaigns. Let the agent build campaigns, landing pages and creatives for your ICPs.

  4. Ads. Turn the campaigns on, monitor the events, and optimize every day for ROAS.

02 / COPY AND PASTE

PROMPTS

5 PROMPTS
01

Connect the tools

PROMPT 01CLAUDE CODE · ANY CODING AGENT
I want to run paid media from this coding agent. First check which tools you already have. If there is no ready connector for Meta Ads or Google Ads, connect through the official APIs: for Meta, a developer app with Marketing API access and an access token for my ad account; for Google Ads, a developer token and OAuth credentials. Give me the exact steps I have to do myself on each platform (account, billing, API access, any approval I have to wait for). Store the credentials outside the repo and never print them. Start with read-only access, then prove it works: list my ad accounts and campaigns on each platform. Do not create, change or spend anything yet.

Meta and Google can take a few days to approve API access, so start this one first.

02

Define the conversion events

PROMPT 02CLAUDE CODE · ANY CODING AGENT
I want to start paid media campaigns and bring traffic to my product. First read this codebase, map my funnel from the first visit to the purchase, and check what tracking already exists. Then define the conversion events (for example landing page view, sign up, demo form, trial start, purchase). For each one give me the name, the moment it fires, where in the code it happens, its value if it has one, and the standard event it maps to on each platform. Tell me which event each platform should optimize for. Show me the table and wait for my OK. Then create the events in my code, reusing the tracking I already have, and in each advertising platform I use, or give me the exact steps where you have no API access.
03

Link click IDs and send conversions back

PROMPT 03CLAUDE CODE · ANY CODING AGENT
Set up conversion tracking in my product. When a visitor lands from an ad, save the click ID from the URL (gclid, gbraid or wbraid for Google, fbclid for Meta, or the platform's own ID) and the UTM parameters in a first-party cookie, and store them with the user in my database at sign up. When that user does one of my conversion events, send it from my server to the platform that brought them: the Meta Conversions API, or Google Ads offline conversion import with enhanced conversions for leads, through the API Google supports today. Give every event one ID so it is never counted twice, and send nothing without the user's consent. Then validate it: send a test for each event and show me the proof from each platform.

This is the one that matters most. If the platform cannot see which clicks became customers, it cannot optimize.

04

Create the campaigns

PROMPT 04CLAUDE CODE · ANY CODING AGENT
Let's create paid media campaigns for my ICPs. Read my website and my product first, then ask me what you cannot find: my ICPs, the countries, the daily budget and the conversion event to optimize for. Show me the plan first: for each ICP the campaigns, the ad groups or ad sets, the keywords or audiences, the ad copy and the landing page. If a landing page is missing or does not match the ad, create a new one in my codebase on a new branch, with the tracking in place. When I approve, create everything on the platforms as paused, confirm it is paused, and give me a summary with links and your recommendations. Do not turn anything on or spend money until I say so.
05

Optimize every day

PROMPT 05CLAUDE CODE · ANY CODING AGENT
Do my daily paid media check. First make sure the tracking is well connected: compare the conversion events in my database with what each ad platform received in the last 7 days, and flag any event that is missing or far off. Then analyze every campaign against its objective (ROAS, or profit, or signups at the beginning to get more volume): spend, conversions, cost per conversion and ROAS, biggest spenders first. Tell me what you would change and why: what to pause, where to move budget, new keywords and negative keywords on Google, audiences or creatives to test. Ask me before you pause a campaign, raise the total daily spend or move more than 20% of a budget, and apply the rest yourself. Save a short log of the changes in a file, so tomorrow's check can compare.

Run it once a day.