Skip to content

Chapter 1: A New Paradigm

The Problem

You've done this before: clicking through screen after screen to set up a campaign. Select the parent segment. Click "Create Segment." Choose the attribute from a dropdown. Select the operator. Enter the value. Add another condition. Choose AND or OR. Configure the activation. Set the schedule. Click through three confirmation dialogs.

Forty-seven clicks later, your segment is live.

Now do it again for the next brand. And the next market. And next quarter when the targeting criteria change.

This is the reality of UI-based marketing operations. Every setup is a performance—unrepeatable, undocumented, and impossible to hand off. When you leave for vacation, no one can recreate what you did. When something breaks, you can't see what changed.

And here's the real problem: AI struggles to help you click.

Some AI tools are starting to navigate web pages, but it's slow, error-prone, and breaks when UIs change. Text is where AI excels—reading, writing, and reasoning about structured information. Every hour you spend clicking is an hour AI cannot reliably assist you.

The Key Idea

Core concept

Marketing as Code means your marketing logic exists as text files—files that AI can read, write, and modify.

Instead of clicking through menus, you describe your segment in a structured text format. Instead of memorizing where settings live in a UI, you have a file you can search, copy, and share.

This isn't about becoming a developer. It's about giving AI the ability to help you.

What This Looks Like

Here's a segment that targets high-value customers for a Q4 win-back campaign:

yaml
name: Q4 Win-Back High Value
description: Customers with LTV over $1000 who haven't purchased in 90 days
rules:
  - attribute: lifetime_value
    operator: Greater
    value: 1000
  - attribute: days_since_last_purchase
    operator: Greater
    value: 90

Ready to sync to Salesforce, Google Ads, or your email platform.

This file represents exactly what you'd configure in a UI: a segment filtering customers by lifetime_value > 1000 and days_since_last_purchase > 90.

The difference is that this file can be:

  • Read by AI — Ask "what does this segment target?" and AI can answer
  • Written by AI — Say "create a segment for high-value customers" and AI generates this file
  • Copied — Duplicate it for another brand in seconds
  • Tracked — See exactly what changed and when
  • Reviewed — A colleague can read it without logging into the platform

Mental Model: Recipes, Not Performances

Think of a UI workflow as a cooking performance. You're in the kitchen, improvising, adding ingredients by feel. The dish might turn out great—but you can't hand someone a recording and expect them to reproduce it.

A YAML file is a recipe. Every ingredient is listed. Every step is documented. Anyone can follow it. Anyone can suggest improvements. And critically: a cooking AI could read this recipe and help you modify it.

Marketing as Code turns your campaigns from performances into recipes.

Why This Matters Now

For years, "infrastructure as code" has transformed how engineering teams work. Server configurations, deployment pipelines, security rules—all managed as text files, reviewed by teams, tracked in version control.

Marketing is the last frontier. Customer segments, journey logic, activation schedules—these have remained trapped in UIs, configured by clicking, documented in screenshots (if at all).

AI changes the equation. With a capable AI assistant:

  • You describe what you want in plain English
  • AI writes the configuration file
  • You review what AI produced
  • AI helps you refine it
  • You deploy with confidence

The barrier wasn't your coding ability. The barrier was that writing code manually is tedious and error-prone. AI removes that barrier.

What You Won't Need to Do

You won't need to:

  • Memorize YAML syntax
  • Type configurations from scratch
  • Debug formatting errors
  • Learn a programming language

AI handles the syntax. Your job is to:

  • Know what you want to achieve
  • Review what AI produces
  • Understand enough to guide AI when refinements are needed

Common Concerns

"I'm not technical."

You don't need to be. You already know marketing—audiences, targeting, customer journeys. That knowledge is the hard part. The YAML syntax is the easy part, and AI handles it anyway.

"What if AI makes mistakes?"

AI will make mistakes. That's why the workflow includes review. You'll learn to read what AI generates—not to write it from scratch, but to verify it makes sense. And you'll use validation tools that catch errors before they reach production.

"Why not improve the UI instead?"

UIs will always have limitations. They're designed for the common case, not your specific need. They can't be searched, diffed, or version-controlled. And fundamentally: AI cannot click buttons in a UI. If you want AI assistance, you need text-based configurations.

What You've Learned

  • Marketing UIs are click-based, unrepeatable, and AI-inaccessible
  • Marketing as Code means your logic exists as text files
  • AI can read, write, and modify text—but not click UIs
  • You describe intent; AI writes the code; you review and deploy
  • The goal is collaboration with AI, not manual coding

Next Step

You understand why code matters. But what exactly is Claude Code, and how is it different from other AI tools? Chapter 2 introduces your AI partner.


You've taken the first step: understanding why code enables AI to help you. The rest of this book shows you how.