Go-to-market engineering · 14 stages
Learn GTM engineering by building it.
A study manual in plain English. Each stage explains one part of how modern companies find, win and keep customers with data and automation. Then it makes you build that part yourself.
How to use this manual
- New to GTM? Start with Part A and Part B. GTM 101 explains how companies win customers. The Builder's Toolkit teaches APIs, JSON, SQL, prompting and Git, which every stage uses. Then do Lab Setup once: it installs your tools and creates the practice data the labs use.
- Read the "In one sentence" box first. If you can explain that sentence to a friend, you understand the stage.
- Learn the words. Every stage has a small list of terms. The glossary has all of them in one place.
- Do the labs, in order. Labs are the orange boxes. Each one has numbered steps, code you can copy, and a "What you should see" check so you know it worked.
- Take the quiz and tick the checklist. Your ticks are saved in this browser, so the progress bar remembers where you stopped.
- Ship the proof of work. Each stage ends with one thing you publish: a repo, a dashboard, a write-up. Fourteen of those is a portfolio that gets you hired.
The route map
The stages follow the life of a customer. First you build clean data. Then you spot buyers, reach them, turn usage into sales, charge for value, measure what worked, help reps sell, keep customers, grow through partners, prove value, and finally show the world your judgment.
Start here
Foundation
Create pipeline
Product & money
Measure & enable
Keep & grow customers
Brand & proof
The agentic frontier
Bonus & reference
Your $0 practice stack
You do not need a company or a budget to practise. Every lab in this manual can run on free plans, free trials or test modes. Check each vendor's pricing page before you sign up, because free limits change.
| Job | Free option to practise with | Used in stages |
|---|---|---|
| Data warehouse | Google BigQuery sandbox (no card needed), or a Snowflake free trial | 1, 5, 7, 9, 11 |
| Transform data | dbt Core (open source, runs on your laptop) | 1, 5, 9 |
| Postgres + vectors | Supabase free project (Postgres with pgvector) | 8, 9 |
| Webhooks & small servers | webhook.site to inspect, Cloudflare Workers free plan to run code | 2, 6, 10 |
| No-code automation | n8n (self-host free), Make or Zapier free plans | 2, 3, 4, 10, 12 |
| Alerts | A free Slack workspace with an Incoming Webhook | 2, 5, 9 |
| Billing | Stripe test mode (fake money, real API) | 6 |
| Product analytics | Segment or RudderStack free tier | 5 |
| Enrichment & outbound | Clay free credits, Apollo free plan | 3, 4 |
| CRM & OAuth | HubSpot free CRM and a free HubSpot developer test account | 1, 10 |
| Dashboards | Looker Studio or Metabase (open source) | 7, 11 |
| Code | Python 3 + Node.js on your laptop, GitHub for your portfolio | all |
A 12-week study rhythm
Spend a "week 0" on GTM 101 and the Toolkit. Then one stage per week works well alongside a job. Each week follows the same five-day loop:
| Day | What you do | Time |
|---|---|---|
| Monday | Read the stage. Learn the words. Take the quiz once, cold. | 1 hr |
| Tue – Thu | Do the labs. Break things. Write down every error and how you fixed it. | 1–2 hrs a day |
| Friday | Build the proof of work. Record a 3-minute Loom walking through it. | 2 hrs |
| Weekend | Post one LinkedIn post about what you built and what surprised you. Retake the quiz. | 45 min |
Start here · Part A
GTM 101: How companies win customers
Before you build anything, understand the game. This page explains go-to-market from zero: the customer journey, the teams, the motions, the tools, the numbers, and where a GTM engineer fits.
Learning outcomes
By the end of this lecture you should be able to:
- Define go-to-market (GTM) strategy and distinguish it from marketing, sales and business strategy.
- Describe the full customer lifecycle using the bow-tie model, and explain why recurring-revenue businesses weight post-sale stages so heavily.
- Define and differentiate total addressable market, ideal customer profile, segment and persona.
- Explain positioning as a structured discipline and apply its five components to a real product.
- Compare the six principal GTM motions and select an appropriate motion from a product's price point, complexity and buyer.
- Calculate and interpret the core unit-economics metrics that govern GTM decisions (CAC, LTV, payback, NRR).
- Explain the emergence of the GTM engineer role and situate it within the revenue organisation.
Prerequisites: none. Reading time: about 60 minutes for the lecture notes, plus 3 hours of labs.
Lecture notes
Lecture A: Foundations of Go-to-Market Strategy
A.1 What go-to-market strategy is, and what it is not
A go-to-market strategy is the coordinated plan by which a company brings a specific offering to a specific set of customers in order to achieve a specific commercial outcome. Formally, it answers four inter-dependent questions: who the company will serve (market selection), what it will offer them and why it is preferable to alternatives (value proposition and positioning), how it will reach, convert and retain them (channels, motion and process), and on what economic terms (pricing, packaging and unit economics).
GTM is frequently confused with adjacent concepts. Business strategy decides which markets the company competes in at all and how it intends to win over many years; GTM is the operational expression of that strategy for one product in one market at one time. Marketing is a function that creates awareness and demand; sales is a function that converts demand into contracts. GTM spans both, and also product, pricing, customer success, partnerships and the data and systems that connect them. A company can have excellent marketing and a strong sales team and still fail because the GTM is incoherent, for example when marketing generates demand from small businesses while the pricing and sales process are designed for enterprises.
A practical test of a GTM strategy is coherence: every element should reinforce every other. A self-serve, low-price product implies a high-volume acquisition channel, a fast onboarding experience and very low cost per customer; an enterprise product with a six-figure contract value implies account selection, multi-stakeholder selling, security review and dedicated post-sale management. Most GTM failures are failures of coherence rather than failures of effort.
A.2 The customer lifecycle: from funnel to bow tie
Classical sales and marketing thinking used the funnel, a model that dates back to the AIDA framework (Attention, Interest, Desire, Action) attributed to the advertising pioneer E. St. Elmo Lewis at the end of the nineteenth century. The funnel is a good description of acquisition: a large population becomes aware, a smaller share becomes interested, a smaller share evaluates, and a fraction buys. Its weakness is that it ends at the purchase.
In a recurring-revenue business (subscription software, usage-based infrastructure, most modern B2B services), the first contract is rarely profitable on its own. The cost of acquiring the customer is usually recovered over many months of retained revenue. The bow-tie model, popularised by the sales consultancy Winning by Design, therefore mirrors the funnel with a second, widening half: onboarding, adoption, renewal and expansion. The knot of the bow tie is the moment of commitment; everything to its right is where lifetime value is realised.
The bow tie changes what an organisation measures. Instead of optimising only for new bookings, it optimises for time to first value (how quickly a new customer achieves the outcome they bought), adoption depth (how much of the product they use) and net revenue retention (whether the cohort's revenue grows over time). It also creates hand-off points between teams, from marketing to sales development, from sales to onboarding, from onboarding to customer success, and each hand-off is a place where context, data and momentum can be lost. Much GTM engineering work exists precisely to close these gaps.
Lifecycle stages as data states
Operationally, each lifecycle stage is a state recorded in a system of record (usually the CRM), and each transition between states is an event with a timestamp. Defining these states precisely is foundational: a "Marketing Qualified Lead" (MQL) is a lead that meets agreed fit and engagement thresholds; a "Sales Qualified Lead" (SQL) is one that a salesperson has accepted as worth pursuing; an "opportunity" is a qualified potential deal with an amount and expected close date. When definitions are vague, conversion rates become meaningless and teams argue about data instead of acting on it.
A.3 Market definition: TAM, segments, ICP and personas
Market definition proceeds from the general to the specific. The total addressable market (TAM) is the total annual revenue available if every potential customer bought the product. The serviceable addressable market (SAM) is the portion the company's current product, geography and channels can actually serve. The serviceable obtainable market (SOM) is the share the company can realistically win in a planning horizon. These figures matter for investors and resource allocation, but they are too broad to guide day-to-day GTM execution.
Segmentation divides the market into groups that behave similarly. B2B companies segment most commonly by company size (small business, mid-market, enterprise), industry, geography and technology environment. Segments matter because they usually require different motions, prices and messages.
The ideal customer profile (ICP) is a precise description of the type of organisation that derives the most value from the product and, in turn, produces the best economics for the seller: high win rates, short sales cycles, low churn and strong expansion. A good ICP is empirical: it is derived from analysis of the best existing customers rather than from aspiration. A persona, by contrast, describes a type of person within the ICP: their role, responsibilities, the metrics on which they are evaluated, and the problems they experience. In B2B purchases there is rarely a single persona; there is a buying group comprising an economic buyer who controls budget, a champion who advocates internally, users, technical evaluators, and procurement or legal approvers.
A.4 Positioning and the value proposition
Positioning is the deliberate definition of how a product is understood relative to the alternatives available to a specific customer. It is not a tagline. April Dunford's widely used framework (Obviously Awesome, 2019) decomposes positioning into five components, each of which can be researched and tested:
- Competitive alternatives: what customers would do if the product did not exist. This is often not a competitor at all but a spreadsheet, an internal script, an agency or simply doing nothing.
- Unique attributes: capabilities the product has that the alternatives lack.
- Value: the benefit those attributes create for the customer, ideally expressed in measurable terms.
- Target customers: those who care most about that value (closely related to the ICP).
- Market category: the frame of reference within which the product is presented, which sets the customer's assumptions about price, competitors and features.
The value proposition condenses positioning into a statement of the outcome a customer receives. Strong value propositions are specific ("cut account research from two days to twenty minutes"), credible (supported by evidence such as case studies) and differentiated (not equally true of every competitor).
A.5 GTM motions
A motion is the dominant mechanism by which a company creates and converts demand. Motions differ in who initiates the relationship, how much human involvement is required and what that involvement costs. The choice is constrained by economics: the cost to acquire a customer must be justified by the revenue that customer will produce. A useful heuristic is that the motion must "fit under" the price. A product sold at $50 per month cannot afford a salesperson's time on every deal; a product sold at $250,000 per year cannot be bought without one.
| Motion | Initiator | Cost per customer | Typical contract value | Primary constraint |
|---|---|---|---|---|
| Product-led (PLG) | The user, via free trial or freemium | Low | Low to mid, expanding | Product must deliver value without assistance |
| Inbound (marketing-led) | The buyer, via search, content or referral | Low to mid | Mid | Buyers must already search for the problem |
| Outbound (sales-led) | The seller | Mid to high | Mid to high | Requires accurate targeting and timing |
| Account-based (ABM) | The seller, on a pre-selected account list | High | High | Small number of high-value accounts |
| Partner / ecosystem | A partner or marketplace | Variable | Variable | Partner incentives must align |
| Community-led | Peers and practitioners | Low marginal, high fixed | Variable | Slow to build, hard to attribute |
Mature companies run hybrid motions. A common pattern is "product-led sales", in which free users self-serve and a sales team engages only the accounts whose usage indicates readiness to buy (Lecture 4). Another is outbound supported by intent signals, in which sellers contact accounts at moments when evidence suggests they are actively evaluating (Lecture 2).
A.6 Unit economics: the arithmetic behind every GTM decision
GTM decisions are ultimately judged by unit economics: the revenue and cost associated with a single customer. Four measures dominate.
Customer acquisition cost (CAC) is total sales and marketing expense in a period divided by the number of new customers acquired in that period. It should include salaries, tools, advertising and agency spend, not just media.
Customer lifetime value (LTV) estimates the gross profit a customer generates over their relationship with the company. A common simplification is average monthly revenue per account multiplied by gross margin, divided by monthly revenue churn. Because the result is very sensitive to the churn estimate, LTV should be treated as an indicator rather than a precise figure.
CAC payback period is the number of months of gross profit required to recover CAC. It is often more useful than LTV because it depends on observable, near-term data and directly governs cash requirements. A company with an 18-month payback must finance a year and a half of each customer's acquisition cost before it earns a return.
Net revenue retention (NRR) measures whether revenue from an existing cohort grows or shrinks over a year, including expansion and churn. An NRR above 100% means the existing base grows even with no new customers; it is the single metric that most clearly separates efficient from inefficient recurring-revenue businesses (Lecture 8).
A.7 The revenue organisation and the GTM engineer
The modern revenue organisation is typically structured by lifecycle stage: marketing (demand generation, product marketing), sales development (SDRs and BDRs), account executives, solutions or sales engineers, customer success and account management. Revenue Operations (RevOps) emerged in the late 2010s to unify the systems, data and processes these teams had previously managed separately, on the principle that a single owner of the end-to-end data model produces better decisions than functional silos.
The GTM engineer role became widespread from around 2023, driven by three developments: the maturation of the cloud data warehouse as a single source of truth; the availability of enrichment and workflow platforms such as Clay that allow non-traditional engineers to compose data pipelines; and the arrival of large language models capable of research, classification and writing at scale. A GTM engineer designs and builds the automated systems that identify, prioritise, reach and retain customers. The role sits between RevOps (which owns process and reporting), data engineering (which owns pipelines and models) and growth (which owns experimentation). What distinguishes strong practitioners is less technical breadth than commercial judgement: the ability to identify which constraint in the GTM system most limits revenue, and to build the smallest reliable system that relieves it.
A.8 How this course is organised
The remaining lectures follow the bow tie. Lecture 1 builds the data foundation on which every other system depends. Lectures 2 and 3 cover the left side of the bow tie: detecting buying intent and conducting personalised outreach at scale. Lectures 4 and 5 address the product and monetisation layer: product-qualified leads and usage-based pricing. Lectures 6 and 7 cover measurement and sales effectiveness. Lectures 8 to 10 cover the right side of the bow tie: retention, ecosystem growth and value realisation. Lectures 11 and 12 address the limits of measurement and the communication of strategic judgement.
Lecture summary
- GTM strategy defines who to serve, what to offer, how to reach and retain them, and on what economic terms; its quality depends on the coherence of these elements.
- The bow-tie model extends the funnel past the purchase, because recurring-revenue businesses realise most value after the first contract.
- TAM, segments, ICP and personas move from broad market sizing to the specific organisations and people a company should pursue; good ICPs are derived from data on the best existing customers.
- Positioning is a structured choice about alternatives, differentiation, value, target customer and category.
- GTM motions must fit the economics of the price point; mature companies combine several.
- CAC, LTV, payback and NRR are the core arithmetic of GTM; retention and expansion often improve economics faster than more acquisition spend.
- The GTM engineer builds the data and automation systems that connect the revenue organisation, guided by commercial judgement about the binding constraint.
Review and discussion questions
- Explain the difference between an ICP and a persona, and why B2B sellers need both.
- Why does the bow-tie model matter more for a subscription business than for a one-off purchase business?
- A product costs $30 per month. Argue which GTM motions are and are not economically viable, and why.
- Using the five components of positioning, describe the positioning of a software product you use daily.
- A company has a CAC of $9,000, ARPA of $600 per month and 75% gross margin. Calculate the payback period and comment on it.
- Discuss: "Most GTM failures are failures of coherence, not effort." Give an example.
Further reading
- Geoffrey A. Moore, Crossing the Chasm (1991; 3rd ed. 2014): technology adoption and the selection of a beachhead market.
- April Dunford, Obviously Awesome (2019): the five-component positioning method.
- Aaron Ross and Marylou Tyler, Predictable Revenue (2011): specialisation of sales roles and outbound process.
- Winning by Design, published material on the bow-tie revenue architecture.
- Wes Bush, Product-Led Growth (2019): when and how the product can serve as the primary acquisition channel.
In one sentence
Go-to-market (GTM) is the plan and the machine a company uses to find the right customers, win them, and keep them happy so they stay and spend more.
The big idea
Building a great product is only half the job. Many good products fail because nobody hears about them, the wrong people are targeted, the price is confusing, or customers leave after three months. Go-to-market is everything that happens between "the product exists" and "the company makes money from it, again and again".
The five questions every GTM plan answers
| Question | The GTM name for it | Example answer |
|---|---|---|
| Who exactly are we selling to? | ICP (Ideal Customer Profile) and personas | US B2B SaaS companies with 50–500 staff; the buyer is the VP of Sales |
| What problem do we solve, and why us? | Value proposition and positioning | "Book more meetings without hiring more SDRs" |
| How much does it cost, and how is it packaged? | Pricing and packaging | $99/month base plus usage (Stage 6) |
| How will they hear about us and start talking to us? | Channels and GTM motion | Outbound email, LinkedIn content, a free plan |
| How do we win, onboard and keep them? | Sales process and customer success | Demo → trial → contract → onboarding → quarterly reviews |
The customer journey: a bow tie, not a funnel
People often draw sales as a funnel: many strangers at the top, a few customers at the bottom. Modern SaaS adds the other half. After someone buys, they must adopt the product, renew, and ideally buy more. Together the two halves look like a bow tie.
The top row is acquisition (winning new customers). The bottom row is retention and expansion (keeping and growing them). In most mature SaaS companies, a big share of new revenue comes from existing customers, which is why Stages 9–11 matter as much as Stages 3–4.
Funnel stages and lead names
Every company names its stages a little differently, but these are the common ones. Learn them; you will see them in every CRM.
| Stage | Meaning | Usually owned by |
|---|---|---|
| Visitor | Someone on the website, still anonymous | Marketing |
| Lead | We know who they are (email, form, list) | Marketing |
| MQL (Marketing Qualified Lead) | Fits the ICP and engaged enough with marketing | Marketing |
| PQL (Product Qualified Lead) | Used the product enough to show buying intent (Stage 5) | Product / growth |
| SQL (Sales Qualified Lead) | Sales agrees it is worth a real conversation. Not the same as SQL the database language. | SDR |
| Opportunity | A real potential deal with an amount and a close date | AE |
| Closed Won / Closed Lost | The deal is signed, or lost | AE |
| Customer → Renewal / Expansion | Paying, then renewing and growing | CSM / Account Manager |
The six GTM motions
A motion is the main way a company finds and wins customers. Most companies run two or three at once.
| Motion | How it works | Best for | Stages that power it |
|---|---|---|---|
| Outbound (sales-led) | Reps reach out first: cold email, calls, LinkedIn | High-value deals, new markets | 2, 3, 4 |
| Inbound (marketing-led) | Content, SEO and ads bring buyers to you | Problems people actively search for | 2, 7 |
| Product-led (PLG) | Free plan or trial; the product sells itself; sales helps big accounts | Easy-to-try tools (Slack, Notion and Calendly grew this way) | 5, 6 |
| Account-based (ABM) | Pick a short list of target companies and surround them with tailored outreach | Enterprise deals with many decision-makers | 1, 2, 3, 4 |
| Partner / ecosystem | Marketplaces, integrations and partners bring you customers | Products that plug into bigger platforms | 10 |
| Community-led | A community of users teaches, recommends and attracts others | Products with passionate practitioners | 12 |
Who is on a GTM team
| Role | What they do | What they need from a GTM engineer |
|---|---|---|
| Marketing (demand gen) | Creates interest: campaigns, content, events, ads | Clean lists, attribution (Stage 7), signal alerts |
| Product marketing (PMM) | Positioning, messaging, pricing, competitor intel | Battlecards and call insights (Stage 8), teardowns |
| SDR / BDR | Finds and qualifies new prospects; books meetings | Researched lists (Stage 3) and drafts (Stage 4), alerts (Stage 2) |
| AE (Account Executive) | Runs demos and closes deals | Account context in the CRM (Stage 1), call summaries |
| Sales engineer | Technical demos and answers | Integration docs and demo data (Stage 10) |
| CSM (Customer Success Manager) | Onboards customers, keeps them healthy, renews | Health scores, alerts, QBR decks (Stages 9, 11) |
| RevOps (Revenue Operations) | Owns the CRM, processes, reporting and forecasting | Data models, dashboards, clean automation |
| GTM engineer | Builds the data, automation and AI systems behind all of the above | (that is you) |
So what is a GTM engineer?
A GTM engineer is part RevOps, part data engineer, part growth marketer. They do not run campaigns or close deals themselves. They build the machines that let everyone else do more, with better data, at the right moment.
- A typical week: fix a broken enrichment workflow, build a new signal alert, write a Clay table for a new ICP, ship a dashboard for the head of sales, and test an AI prompt on 20 rows before scaling it.
- Core skills: SQL, APIs and JSON, one automation tool (Clay, n8n, Make or Zapier), a CRM (HubSpot or Salesforce), prompting LLMs, and enough business sense to know which problem is worth solving.
- What makes a great one: they ask "what decision will this help someone make?" before building anything.
The GTM tech stack, in layers
| Layer | Job | Common tools | Stage |
|---|---|---|---|
| System of record | The official customer and deal database | HubSpot, Salesforce | 1 |
| Data warehouse | All data in one place for analysis | Snowflake, BigQuery, Databricks | 1 |
| Enrichment & prospecting | Find and fill in companies and people | Clay, Apollo, ZoomInfo | 3 |
| Signals & intent | Spot buying moments | RB2B, Warmly, 6sense, G2, Bombora | 2 |
| Engagement | Send sequences and track replies | Outreach, Salesloft, Smartlead, Instantly, Apollo | 4 |
| Product analytics & CDP | Track in-product behaviour | Segment, RudderStack, Amplitude, Mixpanel | 5 |
| Billing | Charge customers | Stripe | 6 |
| BI & reporting | Dashboards and analysis | Looker Studio, Metabase, Tableau | 7, 11 |
| Conversation intelligence | Record and analyse calls | Gong, Chorus | 8 |
| Automation glue | Connect tools together | Zapier, Make, n8n, webhooks | 2, 10 |
| AI | Research, write, classify, summarise | Claude, ChatGPT, Clay AI columns | 3, 4, 8, 11, 12, 14 |
How the 14 stages map to the bow tie
| Part of the journey | Stages |
|---|---|
| Foundation under everything | 1 Data infrastructure |
| Awareness → Interest | 2 Signals, 3 Outbound infra, 4 Offers & testing, 12 Community |
| Evaluation → Purchase | 5 PQL scoring, 6 Pricing, 8 Sales enablement |
| Onboarding → Renewal → Expansion | 9 Churn & NRR, 10 Integrations, 11 QBRs |
| Measuring the whole thing | 7 Attribution & RevOps |
| Proving you can do it | 13 Teardowns & portfolio |
| Running underneath all of it now | 14 Agentic GTM & the context layer |
Try it · Funnel maths
How many visitors do you need to hit a revenue target?
Practical labs
Fill a GTM canvas for a real company
- Pick a real B2B software company you are curious about (or the company you are studying for a course project).
- Open a new Google Sheet and copy the table below into it: three columns, eight rows.
- Answer each line using only public information. Write "unknown" where you cannot find it; that is fine.
| Canvas box | Where to look | Your answer |
|---|---|---|
| ICP (company type, size, region) | Customer logos, case studies | |
| Main persona (job title of the buyer) | Case study quotes, job posts mentioning their tool | |
| Problem solved, in one line | Homepage headline | |
| Positioning vs. 2 competitors | Comparison pages, G2 | |
| Pricing model and value metric | Pricing page | |
| Main GTM motions (pick 2–3) | Free plan? "Book a demo"? Partners page? Community? | |
| Team signals | Their open jobs: SDRs? CSMs? GTM engineers? | |
| One thing you would build for them | This manual's stages |
What you should see: a one-page picture of how this company makes money. If you can fill 6 of 8 boxes, you understand its go-to-market.
Write a sharp ICP and persona
A vague ICP ("tech companies") wastes credits and time. A sharp one lets two different people pull almost the same list of companies.
- Open a new Google Doc and name it ICP – [company name]. Use the company from Lab A.1.
- Click Copy on the template below and paste it into the doc.
- Fill every line in square brackets. Use the evidence you collected in your canvas (customer logos, case studies, job posts).
- Write the Pain line the way a buyer would say it out loud. Look for real phrases in G2 reviews or job posts.
- Test it: send only the ICP line to a friend and ask them to name 5 companies that fit. If their 5 look like the company's real customers, your ICP is sharp. If not, add one more filter (size, region, tool used) and test again.
ICP: [industry] companies in [regions] with [size range] employees
that [use tool X / are doing Y / have problem Z].
Exclude: [who we never sell to, e.g. agencies, under 10 staff, competitors]
Persona: [job title(s)] who own [the problem] and are measured on [their KPI].
Trigger: We talk to them NOW when [a timing signal, e.g. they hire 3+ SDRs].
Pain: In their words: "[the complaint they would say out loud]"
What you should see: a five-line ICP that someone else could turn into a Clay search without asking you any questions.
Map a company's funnel with numbers
- Use the default numbers in the calculator. Note how many visitors you need to hit $240,000.
- Improve only the win rate from 25% to 30%. How many fewer visitors do you need?
- Reset, then improve only visitor → lead from 2% to 3%. Which change helped more?
- Write two sentences: "The cheapest place to improve this funnel is … because …"
What you should see: small improvements in conversion rates multiply through the funnel. This is why GTM engineers obsess over each step, not just "more leads".
Common mistakes
- Building tools before knowing the ICP. Every stage depends on knowing who you are selling to.
- Only thinking about new customers. The right side of the bow tie often brings more revenue.
- Confusing the lead SQL (Sales Qualified Lead) with the database language SQL in conversations. Context tells you which.
- Copying another company's motion. PLG works for easy, cheap tools; it fails for complex enterprise products.
Proof of work
GTM canvas teardown
- Your completed canvas for one real company, published as a short post or page.
- Your sharp ICP and persona written with the template.
- One sentence on "the first thing I would build for them, and why".
Check yourself
Checklist
Start here · Part B
The Builder's Toolkit
Five basic skills that every stage uses: APIs and JSON, SQL, prompting, Git, and the rules for handling data safely. Learn them once here and the 14 stages get much easier.
Learning outcomes
By the end of this lecture you should be able to:
- Explain the client–server model and the structure of an HTTP request and response.
- Distinguish the HTTP methods by their safety and idempotency, and explain why this matters for automation.
- Compare the main API authentication schemes and pagination strategies.
- Describe JSON's data types and how nested data maps to tables.
- Explain the relational model, the meaning of a table's grain, and the behaviour of joins, aggregation and NULL values.
- Describe how large language models generate text, and apply prompt design principles that produce reliable, structured output.
- Explain the purpose of version control and the legal principles that govern personal data in GTM work.
Prerequisites: Lecture A. Reading time: about 60 minutes, plus 6 hours of labs.
Lecture notes
Lecture B: Technical Foundations for GTM Engineering
B.1 The client–server model and HTTP
Almost every system a GTM engineer touches communicates using the Hypertext Transfer Protocol (HTTP). In the client–server model, a client (your script, Clay, a browser) sends a request to a server (Apollo, Stripe, HubSpot), which returns a response. HTTP is stateless: each request must carry everything the server needs to process it, including authentication, which is why API keys are sent on every call rather than once per session.
A request has four parts: a method (the verb), a URL (the resource), headers (metadata such as content type and credentials) and an optional body (the payload, usually JSON). A response has a status code, headers and a body. Modern APIs are almost always sent over HTTPS, which encrypts the exchange with TLS so that credentials and data cannot be read in transit.
Methods, safety and idempotency
HTTP methods are defined not only by what they do but by two formal properties. A method is safe if it does not change server state (GET is safe). A method is idempotent if making the same request several times has the same effect as making it once. GET, PUT and DELETE are idempotent; POST is not. This distinction is central to automation, because networks fail and requests are retried. Retrying an idempotent request is harmless; retrying a non-idempotent POST may create a duplicate contact, a duplicate charge or a duplicate Slack alert. Well-designed APIs therefore accept an idempotency key: a unique identifier sent with a POST so that the server can recognise and ignore a repeat. Stripe's meter-event identifier (Lecture 5) and the event IDs used to deduplicate webhooks (Lecture 2) are applications of this principle.
Status codes
Status codes are grouped by their first digit: 2xx means success, 3xx redirection, 4xx a client error (the request was wrong and retrying it unchanged will fail again), and 5xx a server error (the request may succeed if retried later). Code 429, "Too Many Requests", is a special client error indicating that a rate limit has been exceeded; the correct response is to wait, often for the period given in a Retry-After header, rather than to resend immediately.
B.2 APIs: design, authentication and pagination
An application programming interface (API) is a published contract describing how other software may request data or actions. Most GTM tools expose REST-style APIs, in which resources (contacts, companies, invoices) are addressed by URLs and manipulated with HTTP methods. Some expose GraphQL, in which the client sends a query specifying exactly which fields it needs. Increasingly, tools also publish an MCP server (Model Context Protocol), an interface designed so that AI assistants can discover and call a tool's functions.
Authentication schemes
| Scheme | How it works | Typical use |
|---|---|---|
| API key | A secret string sent in a header such as x-api-key | Server-to-server calls to tools you own (Apollo, Clay) |
| Basic authentication | A username and password (or key and secret) encoded in the Authorization header | Gong, many older APIs |
| Bearer token | A token sent as Authorization: Bearer … | Most modern APIs |
| OAuth 2.0 | A user grants an application limited, revocable access; the application receives tokens | Integrations acting on behalf of a customer (Lecture 9) |
Credentials must never appear in source code, screenshots or shared documents. They are supplied at runtime through environment variables or a secrets manager, and they should carry the narrowest permissions that allow the task (the principle of least privilege).
Pagination and rate limiting
APIs return large result sets in pages. Offset pagination requests "page 3 of 100 records"; it is simple but can skip or duplicate records if data changes between requests. Cursor pagination returns an opaque pointer to the next page and is consistent even as data changes; Gong's API uses this approach. Rate limits are commonly enforced with a token bucket algorithm: each client has a bucket that refills at a fixed rate, and each request consumes a token. Throughput is therefore governed by the refill rate, not by how fast the client can send.
- key = os.environ.get("MY_API_KEY")
- Reads the credential from an environment variable, never from a line of source code — the "credentials must never appear in source code" rule above, applied in the first line of the function.
- headers = {"Authorization": f"Bearer {key}"} if key else {}
- Builds the bearer-token header from the table above, but conditionally: if no key is set, an empty headers dict is sent instead of a header reading
Bearer None. This matters for an API like the one called here (GitHub's public user endpoint), which needs no authentication at all — sending a malformed, empty-looking Authorization header to an endpoint that expects either a real token or none can itself cause some APIs to reject the request, so "no key configured" and "send no auth header" must be the same code path, not an afterthought. - for attempt in range(1, max_tries + 1):
- A bounded retry loop — bounded specifically so a persistently failing API cannot hang the script forever, which an unbounded
while True:retry would risk. - if r.status_code == 429 or r.status_code >= 500: wait = 2 ** attempt
- 429 (rate limited) and 5xx (server error) are the two status-code families that represent a transient, worth-retrying failure — directly implementing the token-bucket interaction described above: a 429 means the bucket is empty, and waiting is the only correct response.
2 ** attemptis exponential backoff: attempt 1 waits 2 seconds, attempt 2 waits 4, attempt 3 waits 8 — spacing retries out further each time so a struggling API is given increasing room to recover rather than being hit immediately again. - raise RuntimeError(f"{r.status_code}: {r.text[:200]}")
- Any other status code (4xx other than 429) is treated as non-retryable: a 404 or a 401 will not fix itself by waiting, so the function fails fast with a clear error instead of wasting four attempts on a request that is wrong, not merely unlucky.
r.text[:200]truncates the error body so a large error page does not flood the terminal.
B.3 Data formats: JSON and the shape of data
JavaScript Object Notation (JSON) is the dominant format for API data. It has six value types: string, number, boolean, null, array (an ordered list) and object (a set of key–value pairs). Objects and arrays may be nested to any depth, which allows JSON to represent hierarchical data naturally: a company object may contain an array of contact objects, each containing an array of email addresses.
Tables, by contrast, are flat. Moving data from an API into a warehouse therefore requires flattening: nested objects become columns (hq.city becomes hq_city) and arrays become separate rows in a child table. Understanding this transformation explains much of the work of ingestion tools and why warehouses provide functions to query semi-structured JSON directly. It also explains why asking an LLM for JSON output is valuable: the structure can be parsed and split into columns deterministically.
The distinction between null and an empty string or a placeholder such as "N/A" is not pedantry. Null means "no value"; it is excluded from counts and averages and can be tested for explicitly. Placeholder text is a value, so it is counted, it breaks numeric operations and it silently corrupts reporting.
B.4 The relational model and SQL
The relational model, introduced by Edgar F. Codd at IBM in 1970, represents data as relations (tables) of rows and columns, connected by keys. A primary key uniquely identifies each row; a foreign key references the primary key of another table. SQL (Structured Query Language) is the declarative language used to query relational data: the user describes the result required, and the database's query planner determines how to compute it.
Grain
The most important property of any table is its grain: what one row represents. An events table has one row per user action; an accounts table has one row per company; an opportunities table has one row per deal. Most analytical errors are grain errors. Joining a table of accounts (one row per company) to a table of events (many rows per company) produces one row per event, so summing an account-level column such as contract value afterwards multiplies it by the number of events. This is called fan-out. The defence is to aggregate each table to the same grain before joining.
Joins
An inner join returns only rows that match in both tables. A left join returns every row from the left table, with nulls where the right table has no match, and is the correct choice when the left table defines the population (for example, all users, whether or not they generated events). A full outer join returns all rows from both sides and is used when reconciling two systems, as in identity resolution (Lecture 1).
Aggregation, NULLs and window functions
Aggregation (GROUP BY with COUNT, SUM, AVG) collapses rows into groups. WHERE filters rows before aggregation; HAVING filters groups after it. SQL uses three-valued logic: comparisons with NULL produce "unknown", so WHERE x = NULL never matches and IS NULL must be used instead. Window functions (ROW_NUMBER, SUM … OVER) compute values across related rows without collapsing them, which makes them essential for sequencing touchpoints, calculating running totals and comparing a row with its predecessors.
B.5 Large language models in GTM systems
A large language model (LLM) is a neural network trained on very large text corpora to predict the next token (a word or word fragment) given the preceding text. Text is generated by repeatedly sampling a likely next token. Two consequences follow. First, an LLM produces plausible text, not verified text: when it lacks information it may generate fluent but false statements, a failure known as hallucination. Second, its output is probabilistic; a parameter called temperature controls how much randomness is allowed, and lower values produce more consistent output.
Reliable use therefore depends on grounding: supplying the model with the specific source material it should use (a scraped webpage, a transcript, a metrics table) and instructing it to use nothing else. Retrieval-augmented generation (Lecture 7) automates this by searching a knowledge base and inserting the relevant passages into the prompt.
Principles of prompt design for production
- Single responsibility: one prompt, one task. Research, classification, scoring and writing are separate steps, each testable on its own.
- Explicit context and objective: state the role, the task and the definition of success.
- Operational definitions: define what counts and what does not ("a routine job post is not a hiring spike").
- Structured output: require JSON with fixed keys and types, so that output is machine-checkable.
- Abstention: instruct the model to return null when evidence is insufficient, and show an example of a null result.
- Evaluation: test on a labelled sample, measure accuracy, change one variable at a time, and only then scale.
B.6 Version control and reproducibility
Version control records every change to a set of files, who made it and why, and allows any earlier state to be recovered. Git is the standard system; GitHub hosts Git repositories online. Each commit is a snapshot with a message; a branch is an independent line of work that can later be merged. For a GTM engineer, version control provides three things: a history of how every pipeline and prompt evolved, the ability to collaborate without overwriting colleagues' work, and a public portfolio that demonstrates competence to employers.
B.7 Data protection and responsible practice
GTM systems process personal data: information relating to an identified or identifiable person, including a work email address. Several legal regimes apply depending on where the data subject is located. The EU and UK General Data Protection Regulation require a lawful basis for processing; B2B prospecting commonly relies on legitimate interest, which requires a documented balancing test showing that the business interest is not overridden by the individual's rights. GDPR also establishes data minimisation (collect only what is necessary), purpose limitation and the right to object. Nigeria's Data Protection Act 2023 follows similar principles. In the United States, the CAN-SPAM Act governs commercial email (accurate headers, a physical address and a functioning opt-out honoured within ten business days). Beyond law, responsible practice means respecting website terms of service, avoiding scraping behind logins, and recognising that personalisation becomes intrusive when it draws on information a reasonable person would not expect a stranger to use.
This section is general information for study, not legal advice.
Lecture summary
- HTTP is a stateless request–response protocol; methods differ in safety and idempotency, which determines how safely they can be retried.
- Status codes distinguish client errors (fix the request) from server errors and rate limits (retry with backoff).
- APIs authenticate with keys, tokens or OAuth, paginate with offsets or cursors, and enforce rate limits; credentials belong in environment variables.
- JSON represents nested data; moving it to tables requires flattening, and null must be distinguished from placeholder text.
- In SQL, grain determines correctness; aggregate to a common grain before joining to avoid fan-out.
- LLMs generate plausible rather than verified text; grounding, structured output, abstention and evaluation make them reliable components.
- Version control provides history, collaboration and a public portfolio; data protection law requires a lawful basis, minimisation and respect for opt-outs.
Review and discussion questions
- Why is POST not idempotent, and how does an idempotency key solve the problem it creates?
- Your script receives a 400, a 429 and a 503 response. Describe the correct handling of each.
- Explain fan-out with an example, and describe two ways to prevent it.
- Why does
WHERE country = NULLreturn no rows? What should be written instead? - Describe three prompt-design techniques that reduce hallucination in an enrichment workflow.
- Discuss the difference between lawful personalisation and intrusive personalisation in cold outreach.
Further reading
- MDN Web Docs, "An overview of HTTP" and "HTTP request methods": authoritative reference for HTTP semantics.
- E. F. Codd, "A Relational Model of Data for Large Shared Data Banks", Communications of the ACM (1970).
- Stripe API documentation, "Idempotent requests": a clear production example of idempotency keys.
- Anthropic, prompt engineering documentation (docs.claude.com): structured prompting and evaluation.
- Information Commissioner's Office (UK), guidance on legitimate interests and direct marketing.
In one sentence
Tools talk to each other through APIs that send JSON, data is questioned with SQL, AI is directed with structured prompts, work is saved in Git, and people's data is handled lawfully.
1. APIs in plain English
An API (application programming interface) is how one piece of software asks another for something. Clay, Apollo, Stripe, Gong and HubSpot all have APIs.
- Endpoint
- The exact address you call, like
https://api.apollo.io/api/v1/people/match. - GET / POST / PATCH / DELETE
- The verbs: read data, send/create data, update part of it, remove it.
- Headers
- Extra info sent with the request, such as your API key and "Content-Type: application/json".
- API key / bearer token
- Your password for the API. Keep it secret. Never put it in code you share.
- Rate limit
- How many calls you may make per second or day. Go over and you get error 429.
- Pagination
- Big results come in pages. You follow a "next" link or cursor to get the rest.
- Webhook vs polling
- Webhook: they call you when something happens. Polling: you keep asking "anything new?"
- Status code
- A 3-digit number saying how the call went (see the table below).
| Code | Meaning | What to do |
|---|---|---|
| 200 / 201 | Success / created | Read the data |
| 400 | Bad request: your input is wrong | Check the fields and format |
| 401 / 403 | Not logged in / not allowed | Check your key and its permissions |
| 404 | Not found | Check the URL or the ID |
| 429 | Too many requests | Wait, then retry slower |
| 500 / 502 / 503 | Their server had a problem | Retry later; not your fault |
Make your first API call and read the JSON
- Open Git Bash (Windows) or Terminal (Mac).
- Call a public API that needs no key. Paste this and press Enter:
curl https://api.github.com/users/octocat
- Read what comes back. It is JSON: pairs of
"key": valueinside curly braces. Findname,company,public_reposandcreated_at. - Make it easier to read. This uses Python (already installed) to indent the JSON neatly:
curl -s https://api.github.com/users/octocat | python -m json.tool
- Pull out only the fields you want, with a one-line Python command:
curl -s https://api.github.com/users/octocat | python -c "import sys, json; d = json.load(sys.stdin); print(d['name'], '|', d['public_repos'], 'repos')"
- Try another user: replace
octocatwithtorvaldsand run step 5 again. - Now study the four JSON shapes you will see in every API. This box is only for reading:
{
"company": "Acme Inc", // text (string)
"employees": 120, // number
"is_customer": false, // true / false (boolean)
"tools": ["HubSpot", "Slack"], // list (array)
"hq": { "city": "Austin", "state": "Texas" }, // object inside an object
"funding": null // empty / not found
}
What you should see: in step 5, The Octocat | 8 repos (the number may differ). To read hq.city in code you write data["hq"]["city"] in Python, or data.hq.city in JavaScript. If you see python: command not found, use py instead.
A safe API call in Python, with retries
- Install Python 3 from
python.org. On Windows, tick "Add python.exe to PATH" on the first install screen. - Open Command Prompt (or Mac Terminal) and check it works:
python --version(on Mac:python3 --version). - Install the requests library:
python -m pip install requests - Make a folder and a file:
mkdir gtm-labs, thencd gtm-labs, thennotepad call_api.py(on Mac:nano call_api.py). - Click Copy on the code below, paste it into the file, and save.
- Run it:
python call_api.py
Real APIs fail sometimes. This pattern is the one you will reuse in every stage: keep the key in an environment variable, check the status, and wait and retry on 429 or 5xx errors.
import os, time, requests
def call_api(url, params=None, max_tries=4):
key = os.environ.get("MY_API_KEY") # your secret key, if the API needs one
headers = {"Authorization": f"Bearer {key}"} if key else {} # no key? send no header
for attempt in range(1, max_tries + 1):
r = requests.get(url, headers=headers, params=params, timeout=30)
if r.status_code == 200:
return r.json()
if r.status_code == 429 or r.status_code >= 500:
wait = 2 ** attempt # 2, 4, 8, 16 seconds
print(f"Got {r.status_code}, waiting {wait}s (try {attempt})")
time.sleep(wait)
continue
raise RuntimeError(f"{r.status_code}: {r.text[:200]}") # 4xx = our mistake, stop
raise RuntimeError("Gave up after retries")
print(call_api("https://api.github.com/users/octocat")["name"])
What you should see: "The Octocat". The waiting-longer-each-time trick is called exponential backoff.
2. SQL in one afternoon
SQL is the language for asking questions of data in a warehouse. You only need about ten patterns for most GTM work. Practise on Google's free public dataset of a fake online shop, thelook_ecommerce, in the BigQuery sandbox (see Stage 1, Lab 1.1 to set it up).
Answer five real GTM questions with SQL
- Open
console.cloud.google.com/bigqueryand sign in. You do not need your own data: these queries use a free public dataset from Google. - Click the + button (Compose new query) to open an empty query tab.
- Click Copy on the box below and paste everything into the tab.
- Run one question at a time: highlight just that query with your mouse (from
selectdown to its;) and click Run. BigQuery runs only the highlighted part. - Read the results under the editor. Under each query in your notes, write one sentence a sales leader would care about.
-- Q1. Which channel brings us the most sign-ups?
select traffic_source, count(*) as users
from `bigquery-public-data.thelook_ecommerce.users`
group by traffic_source
order by users desc;
-- Q2. How many orders per month?
select date_trunc(date(created_at), month) as month, count(*) as orders
from `bigquery-public-data.thelook_ecommerce.orders`
group by month order by month;
-- Q3. Which channel's users actually buy? (join two tables)
select u.traffic_source,
count(distinct u.id) as users,
count(distinct o.user_id) as buyers,
round(count(distinct o.user_id) / count(distinct u.id) * 100, 1) as pct_who_buy
from `bigquery-public-data.thelook_ecommerce.users` u
left join `bigquery-public-data.thelook_ecommerce.orders` o on o.user_id = u.id
group by u.traffic_source
order by pct_who_buy desc;
-- Q4. Repeat customers: who ordered more than once?
select user_id, count(*) as orders
from `bigquery-public-data.thelook_ecommerce.orders`
group by user_id
having count(*) > 1
order by orders desc
limit 20;
-- Q5. Where do visitors drop off on the site? (events funnel)
select event_type, count(distinct session_id) as sessions
from `bigquery-public-data.thelook_ecommerce.events`
group by event_type
order by sessions desc;
What you should see: a results table for each question within a few seconds. Example insight for Q3: "Search brings the most users, but email users buy at a higher rate."
Reading order of a SQL query: FROM (which table) → JOIN (add another table) → WHERE (filter rows) → GROUP BY (make buckets) → HAVING (filter buckets) → SELECT (pick columns) → ORDER BY (sort) → LIMIT (how many).
3. Prompting LLMs for GTM work
Most prompts in this field follow one recipe. It works in Clay, Claude, ChatGPT or any API.
#CONTEXT#
You are a [role, e.g. B2B web researcher]. Research [one signal] only.
#OBJECTIVE#
Find [exact thing] and return [exact output].
#INSTRUCTIONS#
1. Search these sources, in this order: ...
2. Counts as a match: ... Does NOT count: ...
3. Score it: [table of score rules]
4. If unsure or not found, return null. Never guess. Never write "N/A".
#EXAMPLES#
{ "found": true, "date": "March 2026", "score": 3, "explanation": "..." }
{ "found": false, "date": null, "score": 0, "explanation": "..." }
#INPUTS#
Company: {{Company Name}} Domain: {{Domain}} Today: {{Current Date}}
- One job per prompt. Two signals = two prompts.
- Ask for JSON with exact key names, so results split into columns.
- Show the "nothing found" example. It stops the AI making things up.
- Cheap model for sorting text (classify, compare, tidy); stronger model with web search for research.
- Test on 10 rows, fix the prompt, then scale.
4. Git and GitHub for your portfolio
Put your first project on GitHub
- Create a free account at
github.com. - Click + (top right) → New repository. Name it
gtm-portfolio, choose Public, leave every box unticked, and click Create repository. Keep that page open. - In Git Bash/Terminal, tell Git who you are (only needed once on a new computer):
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
- Go to your lab folder and upload it. Replace
YOUR-NAMEwith your GitHub username:
cd ~/gtm-labs
git init
echo ".env" >> .gitignore # never upload secret files
echo ".venv/" >> .gitignore # or Python environments
git add .
git commit -m "First GTM labs: API call and SQL queries"
git branch -M main
git remote add origin https://github.com/YOUR-NAME/gtm-portfolio.git
git push -u origin main
- The first push opens a browser window asking you to sign in to GitHub. Sign in and click Authorize.
- Refresh the GitHub page. In VS Code, create
README.mdingtm-labswith four headings: Problem, What I built, Screenshot, How to run it. Fill them in. - Upload the README:
git add README.md, thengit commit -m "Add README", thengit push.
What you should see: your files on GitHub with your README shown under them, and no .env file in the list. From now on, after each lab: git add . → git commit -m "what you did" → git push.
5. Data rules and ethics
GTM work handles people's personal data. Doing it carelessly can get a client fined or blacklisted. These are the basics; this is general information, not legal advice.
| Rule or law | Where it applies | What it means for you |
|---|---|---|
| CAN-SPAM Act | Commercial email to US recipients | No misleading "From" names or subject lines, include a physical postal address, give a clear way to opt out, and honour opt-outs within 10 business days. |
| GDPR / UK GDPR | People in the EU and UK | You need a lawful basis to process personal data (B2B outreach often relies on "legitimate interest", which needs a balancing test), must honour objections and deletion requests, and should collect only what you need. |
| Nigeria Data Protection Act 2023 | Personal data of people in Nigeria | Similar principles: lawful basis, purpose limits, security, and respecting data subjects' rights. |
| Inbox provider rules | Gmail, Yahoo and others | Authenticate with SPF, DKIM and DMARC, make unsubscribing easy, and keep spam complaints very low (Stage 3). |
| Website terms and robots.txt | Any site you scrape | Respect them, go slowly, never scrape behind logins. |
| Secrets hygiene | Everywhere | Keys live in environment variables or a secrets manager, never in code, screenshots or public repos. |
Common mistakes
- Pasting an API key into code and pushing it to GitHub. Rotate (replace) the key immediately if this happens.
- Retrying a 400 error forever. 4xx errors mean your request is wrong; fix it instead.
- Using
select *on huge tables and burning your free query allowance. - One giant prompt doing research, scoring and writing at once.
Proof of work
Toolkit starter repo
- A
gtm-portfoliorepo with your API script and your five SQL queries. - A README with one business insight per SQL query.
- One reusable prompt written with the 5-part recipe.
Check yourself
Checklist
Start here · Part C
Lab Setup
Do this page once, before the labs. You will install four free tools, learn the five terminal commands you need, and create practice data so every SQL and Python lab in this manual actually runs.
In one sentence
Every lab happens in one of three places: a website (BigQuery, Clay, Stripe, Slack), a code file you run from a terminal, or a prompt you paste into an AI tool. This page sets up all three.
Where does each code box go?
Every grey code box in this manual has a small label in its top-left corner. The label tells you where to use it:
| Label on the box | Where it goes | How you run it |
|---|---|---|
| BASH | A terminal: Git Bash on Windows, Terminal on Mac | Paste and press Enter |
| PYTHON | A file ending in .py inside your gtm-labs folder | python file_name.py in the terminal |
| JAVASCRIPT | A file ending in .js, inside the project the lab tells you to create | The lab gives the exact command |
| SQL | A query tab in the BigQuery console (or Supabase, when the lab says so) | Click Run |
| YAML | A file with the exact name the lab gives (for example schema.yml) | Used by another tool (dbt, GitHub) |
| PROMPT | A Clay AI column, or Claude.ai / ChatGPT for testing | Replace every {{ }} part with real data first |
| TEMPLATE | A Google Doc or Notion page | Copy it and fill in the blanks |
| JSON | Usually an example to read, not run | The lab says if you need it |
Install your four tools
- Git (gives you Git Bash on Windows). Go to
git-scm.com/downloads, download the installer for your system and run it. On Windows, click Next on every screen; the defaults are fine. On Mac, open Terminal and runxcode-select --installinstead. - Python 3. Go to
python.org/downloadsand click Download Python. On Windows, tick "Add python.exe to PATH" on the first screen, then click Install Now. - Node.js. Go to
nodejs.org, download the LTS version and install it with the defaults. You need it for the JavaScript labs (Stages 2, 6 and 10). - VS Code (a free code editor). Go to
code.visualstudio.com, download and install. It makes creating and editing files much easier than Notepad. - Open your terminal. Windows: press the Windows key, type Git Bash, open it. Mac: press Cmd + Space, type Terminal, open it.
- Check everything installed. Paste this and press Enter:
git --version
python --version # on Mac use: python3 --version
node --version
npm --version
What you should see: four version numbers, such as git version 2.47.1, Python 3.13.0, v22.11.0 and 10.9.0. If python opens the Microsoft Store or says "not found" on Windows, use py instead of python everywhere in this manual.
Make your lab folder and learn five commands
You only need five terminal commands for this whole manual:
| Command | What it does |
|---|---|
pwd | Shows which folder you are in now |
ls | Lists the files in this folder |
mkdir name | Makes a new folder |
cd name | Goes into a folder (cd .. goes back up one level) |
code . | Opens this folder in VS Code |
- Create your lab folder and open it in VS Code:
cd ~
mkdir gtm-labs
cd gtm-labs
python -m pip install requests pandas scikit-learn matplotlib python-pptx beautifulsoup4
code .
- In VS Code, create a file: click File → New File, type the name
hello.py, press Enter, then choose yourgtm-labsfolder if asked. - Type
print("My lab folder works")into it and press Ctrl + S (Mac: Cmd + S) to save. - Back in the terminal, run it:
python hello.py
What you should see: My lab folder works. This is how every Python lab runs: create the file, paste the code, save, run python file_name.py from inside gtm-labs. Every time you open a new terminal, run cd ~/gtm-labs first.
API keys and secrets
Many labs need a secret key (Apollo, Stripe, OpenAI). Never paste a key inside a code file. Instead, set it in the terminal just before you run your script. It lasts until you close that terminal window.
| Terminal | Set a key |
|---|---|
| Git Bash or Mac Terminal | export APOLLO_API_KEY="paste-your-key-here" |
| Windows Command Prompt | set APOLLO_API_KEY=paste-your-key-here |
| Windows PowerShell | $env:APOLLO_API_KEY="paste-your-key-here" |
Then run the script in the same window. The code reads the key with os.environ["APOLLO_API_KEY"] (Python) or process.env.APOLLO_API_KEY (JavaScript).
Create the practice data in BigQuery
- Do Stage 1, Lab 1.1 steps 1–2 first if you have not: create a free BigQuery sandbox project and a dataset named exactly
gtm_lab. - In the BigQuery console, click the + (Compose new query) button to open an empty query tab.
- Click Copy on the box below, paste the whole thing into the query tab, and click Run. BigQuery runs it as one script, statement by statement.
- Wait for it to finish (under a minute). In the Explorer panel on the left, click the arrow next to
gtm_labto see your new tables. - Check it worked: open a new query tab and run
select count(*) from gtm_lab.events
-- GTM Field Manual · practice data for BigQuery
-- Creates every table the SQL labs use, inside your gtm_lab dataset.
-- Paste it all into a BigQuery query tab and click Run. Takes under a minute.
-- The data is fake but realistic, and the same every time you run it.
-- 1. Companies (200)
create or replace table gtm_lab.accounts as
select
concat('acct_', cast(i as string)) as account_id,
concat(['Acme','Northwind','Bluepeak','Riverstone','Brightlane','Cobalt','Evergreen','Summit','Lumen','Harbor'][offset(mod(i, 10))], ' ', cast(i as string)) as name,
concat('company', cast(i as string), '.com') as domain,
[12, 35, 80, 150, 300, 600, 1200][offset(mod(abs(farm_fingerprint(concat('emp', cast(i as string)))), 7))] as employees,
['Technology','Financial Services','Healthcare','Retail','Manufacturing','Education'][offset(mod(abs(farm_fingerprint(concat('ind', cast(i as string)))), 6))] as industry
from unnest(generate_array(1, 200)) as i;
-- 2. Product users (2,000), 10 per company
create or replace table gtm_lab.users as
select
concat('u_', cast(i as string)) as user_id,
concat('acct_', cast(mod(i, 200) + 1 as string)) as account_id,
concat('user', cast(i as string), '@company', cast(mod(i, 200) + 1 as string), '.com') as email,
timestamp_sub(current_timestamp(), interval 30 + mod(abs(farm_fingerprint(concat('su', cast(i as string)))), 150) day) as signup_at
from unnest(generate_array(1, 2000)) as i;
-- 3. Product events: a first-week burst for everyone, ongoing use for engaged users
create or replace table gtm_lab.events as
with u as (
select user_id, account_id, signup_at,
mod(abs(farm_fingerprint(concat('eng', user_id))), 10) as eng,
cast(substr(account_id, 6) as int64) as acct_num
from gtm_lab.users
),
onboarding as (
select user_id, account_id, acct_num,
timestamp_add(signup_at, interval mod(abs(farm_fingerprint(concat(user_id, 'd', cast(j as string)))), 168) hour) as event_at,
mod(abs(farm_fingerprint(concat(user_id, 'e', cast(j as string)))), 10) as pick
from u, unnest(generate_array(1, 3 + eng * 5)) as j
),
ongoing as (
select user_id, account_id, acct_num,
timestamp_add(signup_at, interval d * 24 + mod(abs(farm_fingerprint(concat(user_id, 'h', cast(d as string)))), 24) hour) as event_at,
mod(abs(farm_fingerprint(concat(user_id, 'p', cast(d as string)))), 10) as pick
from u, unnest(generate_array(7, timestamp_diff(current_timestamp(), signup_at, day))) as d
where eng >= 4 and mod(abs(farm_fingerprint(concat(user_id, 'o', cast(d as string)))), 2) = 0
),
all_events as (
select * from onboarding
union all
select * from ongoing
)
select user_id, account_id,
['Report Created','Report Created','Dashboard Viewed','Dashboard Viewed','Teammate Invited',
'Integration Connected','Pricing Page Viewed','Task Automated','Task Automated','Plan Limit Reached'][offset(pick)] as event_name,
event_at
from all_events
where event_at <= current_timestamp()
and not (mod(acct_num, 7) = 0 and event_at >= timestamp_sub(current_timestamp(), interval 7 day));
-- 4. Sales opportunities (400)
create or replace table gtm_lab.opportunities as
with base as (
select
concat('opp_', cast(i as string)) as opportunity_id,
concat('acct_', cast(1 + mod(abs(farm_fingerprint(concat('oa', cast(i as string)))), 200) as string)) as account_id,
['Ada','Tunde','Mary','Chidi'][offset(mod(abs(farm_fingerprint(concat('ow', cast(i as string)))), 4))] as owner,
['Outbound','Inbound','Paid ads','Partner','Events'][offset(mod(abs(farm_fingerprint(concat('ls', cast(i as string)))), 5))] as lead_source,
1000 * (5 + mod(abs(farm_fingerprint(concat('am', cast(i as string)))), 46)) as amount,
timestamp_sub(current_timestamp(), interval 20 + mod(abs(farm_fingerprint(concat('cr', cast(i as string)))), 380) day) as created_at,
40 + mod(abs(farm_fingerprint(concat('cy', cast(i as string)))), 90) as raw_cycle,
mod(abs(farm_fingerprint(concat('wn', cast(i as string)))), 100) as roll,
mod(abs(farm_fingerprint(concat('pi', cast(i as string)))), 6) = 0 as influenced_roll,
['HubSpot','Zapier','Crossbeam'][offset(mod(abs(farm_fingerprint(concat('pn', cast(i as string)))), 3))] as some_partner
from unnest(generate_array(1, 400)) as i
),
shaped as (
select *,
lead_source = 'Partner' as partner_sourced,
lead_source != 'Partner' and influenced_roll as partner_influenced,
raw_cycle - if(lead_source = 'Partner', 25, if(influenced_roll, 15, 0)) as cycle_days
from base
)
select opportunity_id, account_id, owner, lead_source, amount, created_at,
case
when timestamp_add(created_at, interval cycle_days day) > current_timestamp() then 'Negotiation'
when roll < (case when partner_sourced then 45 when partner_influenced then 40 when lead_source = 'Inbound' then 32 else 22 end) then 'Closed Won'
else 'Closed Lost'
end as stage,
if(timestamp_add(created_at, interval cycle_days day) > current_timestamp(), null,
timestamp_add(created_at, interval cycle_days day)) as closed_at,
cycle_days,
if(partner_sourced or partner_influenced, some_partner, null) as partner_name,
partner_sourced,
partner_influenced
from shaped;
-- 5. Marketing touchpoints before each deal (2 to 6 per deal)
create or replace table gtm_lab.touchpoints as
select o.opportunity_id,
['Blog post','Webinar','Cold email','LinkedIn post','Paid ad','Podcast','Demo request'][offset(mod(abs(farm_fingerprint(concat(o.opportunity_id, 'c', cast(k as string)))), 7))] as channel,
timestamp_add(timestamp_sub(o.created_at, interval 60 day),
interval mod(abs(farm_fingerprint(concat(o.opportunity_id, 't', cast(k as string)))), 60 + o.cycle_days) day) as touched_at
from gtm_lab.opportunities o,
unnest(generate_array(1, 2 + mod(abs(farm_fingerprint(concat(o.opportunity_id, 'n'))), 5))) as k
where timestamp_add(timestamp_sub(o.created_at, interval 60 day),
interval mod(abs(farm_fingerprint(concat(o.opportunity_id, 't', cast(k as string)))), 60 + o.cycle_days) day) <= current_timestamp();
-- 6. Leads moving through the funnel (3,000)
create or replace table gtm_lab.leads as
with l as (
select concat('lead_', cast(i as string)) as lead_id,
['Outbound','Inbound','Paid ads','Partner','Events'][offset(mod(abs(farm_fingerprint(concat('lsrc', cast(i as string)))), 5))] as source,
timestamp_sub(current_timestamp(), interval mod(abs(farm_fingerprint(concat('lc', cast(i as string)))), 365) day) as created_at,
mod(abs(farm_fingerprint(concat('r1', cast(i as string)))), 100) as r1,
mod(abs(farm_fingerprint(concat('r2', cast(i as string)))), 100) as r2,
mod(abs(farm_fingerprint(concat('r3', cast(i as string)))), 100) as r3,
mod(abs(farm_fingerprint(concat('r4', cast(i as string)))), 100) as r4
from unnest(generate_array(1, 3000)) as i
)
select lead_id, source, created_at,
if(r1 < 40, timestamp_add(created_at, interval 2 day), null) as mql_at,
if(r1 < 40 and r2 < 30, timestamp_add(created_at, interval 6 day), null) as sql_at,
if(r1 < 40 and r2 < 30 and r3 < 60, timestamp_add(created_at, interval 10 day), null) as opp_at,
if(r1 < 40 and r2 < 30 and r3 < 60 and r4 < 25, timestamp_add(created_at, interval 50 day), null) as won_at
from l;
-- 7. Monthly subscription revenue for paying customers
create or replace table gtm_lab.subscriptions_monthly as
with c as (
select account_id,
date_sub(date_trunc(current_date(), month), interval mod(abs(farm_fingerprint(concat('start', account_id))), 18) month) as start_month,
100 * (2 + mod(abs(farm_fingerprint(concat('mrr', account_id))), 19)) as base_mrr,
mod(abs(farm_fingerprint(concat('churn', account_id))), 5) = 0 as churns,
3 + mod(abs(farm_fingerprint(concat('life', account_id))), 9) as life_months,
mod(abs(farm_fingerprint(concat('g', account_id))), 3) as growth
from gtm_lab.accounts
where mod(cast(substr(account_id, 6) as int64), 5) != 0
)
select account_id, m as month,
base_mrr + 50 * date_diff(m, start_month, month) * growth as mrr
from c, unnest(generate_date_array(start_month, date_trunc(current_date(), month), interval 1 month)) as m
where not churns or date_diff(m, start_month, month) < life_months;
-- 8. Health score inputs
create or replace table gtm_lab.usage_rollup as
select account_id,
countif(event_at >= timestamp_sub(current_timestamp(), interval 30 day)) as events_30d,
countif(event_at < timestamp_sub(current_timestamp(), interval 30 day)
and event_at >= timestamp_sub(current_timestamp(), interval 60 day)) as events_prev_30d,
count(distinct if(event_at >= timestamp_sub(current_timestamp(), interval 30 day), event_name, null)) as features_used_30d
from gtm_lab.events
group by account_id;
create or replace table gtm_lab.ticket_rollup as
select account_id,
mod(abs(farm_fingerprint(concat('tk', account_id))), 6) as open_tickets,
if(mod(abs(farm_fingerprint(concat('p1', account_id))), 4) = 0, 1, 0) as p1_tickets_90d
from gtm_lab.accounts;
create or replace table gtm_lab.contact_rollup as
select account_id,
mod(abs(farm_fingerprint(concat('ch', account_id))), 4) != 0 as champion_active_30d
from gtm_lab.accounts;
create or replace table gtm_lab.billing_rollup as
select account_id,
if(mod(abs(farm_fingerprint(concat('bl', account_id))), 8) = 0, 1, 0) as invoices_overdue
from gtm_lab.accounts;
-- 9. Seats bought vs used
create or replace table gtm_lab.seat_rollup as
with s as (
select account_id,
[5, 10, 20, 50][offset(mod(abs(farm_fingerprint(concat('ps', account_id))), 4))] as purchased_seats,
50 + mod(abs(farm_fingerprint(concat('as', account_id))), 51) as pct_used
from gtm_lab.accounts
)
select account_id, purchased_seats,
cast(round(purchased_seats * pct_used / 100) as int64) as active_seats
from s;
-- 10. Customer goals for QBRs
create or replace table gtm_lab.success_plans as
with g as (
select account_id, 5 + mod(abs(farm_fingerprint(concat('gb', account_id))), 15) as goal_1_baseline,
10 + mod(abs(farm_fingerprint(concat('gt', account_id))), 20) as lift
from gtm_lab.accounts
)
select account_id, 'Weekly active users' as goal_1_name, goal_1_baseline, goal_1_baseline + lift as goal_1_target
from g;
create or replace table gtm_lab.goal_metrics as
select account_id,
goal_1_baseline + mod(abs(farm_fingerprint(concat('gc', account_id))), goal_1_target - goal_1_baseline + 6) as goal_1_current
from gtm_lab.success_plans;
-- 11. Sign-ups with software attribution vs. what people said
create or replace table gtm_lab.signups as
with s as (
select i,
mod(abs(farm_fingerprint(concat('sg', cast(i as string)))), 100) as r,
mod(abs(farm_fingerprint(concat('sw', cast(i as string)))), 100) as w
from unnest(generate_array(1, 600)) as i
)
select concat('signup_', cast(i as string)) as signup_id,
case when r < 45 then 'direct' when r < 70 then 'organic_search' when r < 85 then 'paid_social' else 'referral' end as software_source,
case
when r < 45 then ['podcast','friend_or_colleague','linkedin_post','community_slack_discord','newsletter'][offset(mod(w, 5))]
when r < 70 then ['search_engine','search_engine','ai_assistant','review_site'][offset(mod(w, 4))]
when r < 85 then ['linkedin_post','event_or_webinar','other'][offset(mod(w, 3))]
else ['friend_or_colleague','community_slack_discord'][offset(mod(w, 2))]
end as sra_primary
from s;
-- Done. Check: select count(*) from gtm_lab.events;
What you should see: 15 new tables in gtm_lab (accounts, users, events, opportunities, touchpoints, leads and more) and tens of thousands of rows in events. The data is fake but behaves like a real SaaS company, so your lab results will look realistic.
Create the practice files for the Python labs
- In VS Code, create a new file in
gtm-labsnamedmake_practice_files.py. - Click Copy on the box below, paste it into the file, and save.
- In the terminal (inside
gtm-labs), run:python make_practice_files.py
# make_practice_files.py
# Creates every practice file the Python labs need, using only built-in Python.
# Run it once inside your gtm-labs folder: python make_practice_files.py
import csv, json, math, random
from datetime import date, timedelta
random.seed(42) # same "random" data every time, so your results match the manual
def write_csv(name, header, rows):
with open(name, "w", newline="", encoding="utf-8") as f:
w = csv.writer(f)
w.writerow(header)
w.writerows(rows)
print(f"created {name} ({len(rows)} rows)")
# 1. Renewal history + upcoming renewals (Stage 9, Lab 9.4)
def account_features():
usage_change = round(random.uniform(-80, 60), 1)
features = random.randint(0, 10)
tickets = random.randint(0, 8)
champion = random.choice([0, 1, 1])
days_idle = random.randint(0, 60)
overdue = random.choice([0, 0, 0, 1, 2])
return [usage_change, features, tickets, champion, days_idle, overdue]
def churn_probability(f):
usage, feats, tickets, champ, idle, overdue = f
z = -0.6 - 0.03 * usage - 0.25 * feats + 0.2 * tickets - 1.2 * champ + 0.04 * idle + 0.6 * overdue
return 1 / (1 + math.exp(-z))
cols = ["usage_change_pct", "features_used", "open_tickets", "champion_active",
"days_since_last_login", "overdue_invoices"]
history = []
for i in range(1, 501):
f = account_features()
history.append([f"acct_{i}"] + f + [1 if random.random() < churn_probability(f) else 0])
write_csv("renewals_history.csv", ["account_id"] + cols + ["churned"], history)
upcoming = [[f"acct_{i}"] + account_features() for i in range(501, 541)]
write_csv("upcoming_renewals.csv", ["account_id"] + cols, upcoming)
# 2. Weekly word-of-mouth data (Stage 12, Lab 12.4)
weeks = [date(2025, 11, 3) + timedelta(weeks=i) for i in range(52)]
mentions = [max(0, int(random.gauss(12, 6))) for _ in weeks]
weekly = []
for i, wk in enumerate(weeks):
lag1 = mentions[i - 1] if i >= 1 else 12
lag2 = mentions[i - 2] if i >= 2 else 12
branded = int(60 + 3 * lag1 + random.gauss(0, 8))
signups = int(25 + 2.2 * lag2 + random.gauss(0, 5))
weekly.append([wk.isoformat(), mentions[i], branded, signups])
write_csv("weekly.csv", ["week", "mentions", "branded_searches", "signups"], weekly)
# 3. QBR metrics + weekly usage per account (Stage 11, Labs 11.2 and 11.4)
qbr_accounts = [("acct_9", "Acme Inc"), ("acct_14", "Northwind Ltd"), ("acct_23", "Bluepeak Health"),
("acct_31", "Riverstone Retail"), ("acct_47", "Cobalt Logistics")]
qbr, usage = [], []
for acct_id, name in qbr_accounts:
users = random.randint(8, 60)
tasks = random.randint(300, 2500)
baseline = random.randint(5, 20)
target = baseline + random.randint(10, 30)
current = baseline + random.randint(5, target - baseline + 5)
qbr.append([acct_id, name, users, random.randint(40, 400), tasks, round(tasks * 6 / 60),
"Weekly active users", baseline, target, current])
level = users * 0.6
for w in range(13):
level = max(1, level + random.gauss(0.6, 2.5))
usage.append([acct_id, (date(2026, 7, 6) + timedelta(weeks=w)).isoformat(), round(level)])
write_csv("qbr_metrics.csv", ["account_id", "name", "active_users", "reports_created", "tasks_automated",
"hours_saved", "goal_1_name", "goal_1_baseline", "goal_1_target",
"goal_1_current"], qbr)
write_csv("weekly_usage.csv", ["account_id", "week", "active_users"], usage)
# 4. Mock sales call transcripts (Stage 8, Labs 8.2 to 8.5)
lines = {
"pricing": [
"Honestly the price feels steep for a team our size.",
"Our budget for tools is pretty tight until next quarter.",
"RivalCo quoted us about half of what you are asking.",
"Can we start smaller and grow into the bigger plan?",
],
"competitor": [
"We already use RivalCo for some of this, so why switch?",
"RivalCo has a Salesforce integration that we rely on.",
"Our team trialled RivalCo last year but the data was stale.",
],
"pain": [
"My reps spend hours every week researching accounts by hand.",
"We keep emailing the wrong people because our CRM data is old.",
"Nobody knows which accounts are actually showing buying signals.",
],
"security": [
"Our security team will ask about SOC 2 before we sign anything.",
"Where is our data stored, and who can access it?",
],
"rep": [
"That makes sense. Most teams your size start on the Pro plan and upgrade later.",
"Compared to RivalCo, we refresh data daily and cover more sources.",
"We can share our security documentation right after this call.",
"If we saved each rep five hours a week, what would that be worth to you?",
"Let's set up a two-week pilot with three of your reps.",
],
}
transcripts = []
for c in range(1, 7):
call_id = f"call_{100 + c}"
for turn in range(12):
if turn % 2 == 0:
topic = random.choice(["pricing", "competitor", "pain", "security"])
transcripts.append({"call_id": call_id, "speaker_id": "buyer", "text": random.choice(lines[topic])})
else:
transcripts.append({"call_id": call_id, "speaker_id": "rep", "text": random.choice(lines["rep"])})
with open("transcripts.json", "w", encoding="utf-8") as f:
json.dump(transcripts, f, indent=2)
print(f"created transcripts.json ({len(transcripts)} speaker turns)")
# 5. "How did you hear about us?" answers (Stage 12, Lab 12.1)
answers = [
"my friend who runs RevOps at a fintech told me about you",
"heard the founder on a podcast about outbound",
"someone shared a LinkedIn post in our founders WhatsApp group",
"google search for clay alternatives",
"a newsletter I read every week mentioned you",
"saw a webinar recording on YouTube",
"my old boss uses it at her new company",
"ChatGPT recommended it when I asked for prospecting tools",
"G2 comparison page",
"a post in the RevGenius Slack",
"cold email from one of your reps",
"can't remember, maybe twitter",
]
write_csv("sra_answers.csv", ["id", "answer"], [[i, random.choice(answers)] for i in range(1, 61)])
print("\nAll practice files are ready in this folder.")
What you should see: seven lines starting with "created", for renewals_history.csv, upcoming_renewals.csv, weekly.csv, qbr_metrics.csv, weekly_usage.csv, transcripts.json and sra_answers.csv. Run ls to see them. Keep every lab script in this same folder so it can find these files.
If something goes wrong
| Error message | What it means | Fix |
|---|---|---|
command not found / is not recognized | The tool is not installed or not on PATH | Reinstall it (tick "Add to PATH" for Python), then close and reopen the terminal |
No module named 'pandas' | A Python library is missing | python -m pip install pandas (use the name in the error) |
No such file or directory | You are in the wrong folder | cd ~/gtm-labs, then ls to check the file is there |
SyntaxError | The code was mistyped | Delete it and paste again using the Copy button |
KeyError: 'APOLLO_API_KEY' | The key was not set in this terminal window | Run the export line again, in the same window |
BigQuery: Not found: Table | Practice data missing or expired | Run Lab S.3 again |
401 or 403 from an API | Wrong key, or the key lacks permission | Copy the key again from the tool's settings; check it is a test key where the lab says so |
Checklist
Stage 01 · Foundation
Data Infrastructure & Reverse ETL
Build one trusted record of every customer, then push it back into the tools your sales and marketing teams use every day.
Learning outcomes
By the end of this lecture you should be able to:
- Explain why fragmented customer data degrades GTM performance, and define a single source of truth.
- Describe the architecture of the modern data stack and distinguish ETL from ELT.
- Apply dimensional modelling concepts (facts, dimensions, grain, slowly changing dimensions) to GTM data.
- Explain layered transformation (staging, intermediate, marts) and the role of testing in dbt.
- Compare deterministic and probabilistic identity resolution and evaluate their error trade-offs.
- Explain reverse ETL, its sync semantics and its governance risks, and contrast warehouse-native with application-centric architectures.
Prerequisites: Lecture B (SQL, JSON). Reading time: about 60 minutes, plus 8–10 hours of labs.
Lecture notes
Lecture 1: Data Infrastructure and Reverse ETL
1.1 The problem of fragmented customer data
A typical B2B company runs dozens of SaaS applications, and each maintains its own model of the customer. The CRM records contacts, accounts and opportunities; the product database records users and their actions; the billing system records subscriptions and invoices; the support desk records tickets; the marketing automation platform records email engagement. Each system uses different identifiers, different field definitions and different update schedules. The result is data fragmentation: no single place holds a complete and consistent view of any customer.
Fragmentation has direct commercial costs. Sales representatives act on incomplete context, for example prospecting an account that already pays for the product. Marketing cannot suppress existing customers from acquisition campaigns. Customer success cannot see product usage alongside contract renewal dates. Leadership receives conflicting numbers from different tools and loses confidence in all of them. The objective of the data infrastructure layer is to establish a single source of truth (SSOT): one governed location in which data from all systems is integrated, reconciled and defined, and from which every downstream tool and report draws.
1.2 The modern data stack
The term modern data stack describes the architecture that became dominant in the 2010s as cloud data warehouses matured. Its components are:
- Sources: operational systems (CRM, product database, billing, support).
- Ingestion: managed connectors (Fivetran, Airbyte) that replicate source data into the warehouse on a schedule, handling API pagination, schema changes and incremental loading.
- Storage and compute: a cloud data warehouse (Snowflake, BigQuery, Databricks, Redshift) that separates storage from compute, scales elastically and charges by usage.
- Transformation: SQL-based modelling, most commonly with dbt, that turns raw replicas into clean, tested, business-ready tables.
- Activation: reverse ETL tools (Hightouch, Census) that sync modelled data back into operational systems.
- Consumption: BI dashboards, notebooks and AI applications that read from the modelled layer.
ETL versus ELT
Traditional data warehousing used ETL (extract, transform, load): data was transformed on a separate server before being loaded, because warehouse compute was expensive and storage limited. Cloud warehouses inverted these constraints. Storage became cheap and compute elastic, so it became more efficient to load raw data first and transform it inside the warehouse (ELT). ELT has three advantages: raw data is preserved, so transformations can be rewritten and rerun; transformation logic is expressed in SQL, which analysts can read and maintain; and the warehouse's parallel compute performs transformations faster than a separate server.
1.3 Dimensional modelling for GTM
Dimensional modelling, formalised by Ralph Kimball in The Data Warehouse Toolkit (1996), organises analytical data into two kinds of table. Fact tables record measurable business events at a declared grain: one row per opportunity stage change, per product event, per invoice line. Dimension tables describe the entities involved in those events: accounts, contacts, products, dates. Facts are joined to dimensions through keys, forming a star schema. The model optimises for analytical queries and for comprehensibility: a business user can understand that "revenue" lives in a fact table and "industry" in an account dimension.
Two concepts from dimensional modelling are especially important in GTM work. The first is grain (Lecture B): every table must have exactly one declared meaning per row. The second is the slowly changing dimension (SCD): attributes of an entity change over time, and the model must decide whether to overwrite the old value (Type 1) or preserve history by adding a new row with validity dates (Type 2). If an account moves from "Mid-market" to "Enterprise", a Type 1 model rewrites history, so last year's mid-market revenue silently becomes enterprise revenue; a Type 2 model reports each period correctly. Customer segment, account owner and lifecycle stage are attributes that usually require Type 2 treatment.
1.4 Layered transformation and dbt
dbt (data build tool), created by Fishtown Analytics (now dbt Labs) around 2016, applies software-engineering practices to SQL transformation. Each model is a SELECT statement in a file; dbt resolves dependencies declared with ref(), builds a directed acyclic graph (DAG) of models, and materialises them as tables or views in dependency order. It adds version control, testing, documentation and lineage to what was previously a collection of ad hoc scripts.
A widely adopted convention organises models in three layers:
| Layer | Purpose | Typical operations |
|---|---|---|
Staging (stg_) | One model per source table; light cleaning only | Rename columns, cast types, lower-case emails, trim whitespace |
Intermediate (int_) | Reusable business logic | Identity resolution, deduplication, joins across sources |
Marts (dim_, fct_) | Final, consumer-facing tables | Account and contact dimensions, opportunity and event facts |
This separation localises change: if a source system renames a field, only one staging model changes. dbt tests assert properties of the data: unique and not_null on keys, accepted_values on categorical fields, and relationships to confirm that foreign keys resolve. Tests convert silent data errors, the most dangerous kind, into visible build failures before the data reaches a dashboard or a CRM.
1.5 Identity resolution
Identity resolution (also called entity resolution or record linkage) is the process of determining which records across systems refer to the same real-world entity. It is the central technical problem in building a customer 360 view, because systems rarely share a common identifier.
Deterministic matching
Deterministic methods link records when one or more identifiers match exactly after normalisation, for example identical lower-cased, trimmed email addresses, or identical registered email domains. They are transparent and auditable, and they rarely link records that should not be linked, but they miss variants (a personal email in one system and a work email in another).
Probabilistic matching
Probabilistic methods compute a likelihood that two records match from the similarity of several fields (name, company, location, phone), and link them above a threshold. The statistical foundation is the Fellegi–Sunter model (1969), which weights each field by how strongly agreement on it indicates a true match. Probabilistic matching finds more true matches but introduces false positives, records wrongly merged.
The two error types have asymmetric costs. A false negative (failing to merge two records of the same customer) produces duplicate outreach and incomplete history. A false positive (merging two different customers) can expose one customer's data to another's account team or send renewal communications to the wrong company. Most GTM systems therefore use deterministic rules for automated merging and route probabilistic candidates to human review.
Account matching by domain
In B2B, contacts are usually rolled up to accounts by email domain. This requires an exclusion list of free and personal email providers, handling of companies that use several domains, and handling of subsidiaries that share a parent domain. The output of identity resolution is a golden record: a single, governed representation of each person and each account, with a stable identifier and documented rules for which source wins when values conflict (survivorship rules).
- select lower(trim(email)) as email, 'crm' as src from gtm_lab.crm_contacts union all select lower(trim(email)), 'app' from ...
- This is deterministic matching from §1.5, implemented directly:
lower(trim(email))normalises each email to a canonical form before any comparison happens, exactly the normalisation step that makes " Ada@Acme.com" and "ada@acme.com" match.union all(rather than plainunion) stacks the three source tables' emails into one list without the extra cost of de-duplicating rows that a plain union would perform — de-duplication happens later, deliberately, by domain rather than by email. - select split(email, '@')[offset(1)] as domain, count(distinct email) as known_people from people group by 1
- Implements "account matching by domain":
split(email, '@')breaks the email into two parts around the @ sign, and[offset(1)](BigQuery's zero-indexed array access) takes the second part — the domain.count(distinct email), not plaincount(*), matters because the same person's email could appear in more than one source system (CRM and app), and the question here is how many distinct people share a domain, not how many source-system rows exist. - left join usage u using (domain) left join billing b using (domain)
- Both joins are left joins from the domain list: a company with people but no logged-in usage, or no billing record, must still appear in the result (with NULL in the missing column) rather than disappearing — an inner join here would silently drop every account that has not yet started paying, which is exactly the population a GTM engineer most needs to see.
- where d.domain not in ('gmail.com','yahoo.com','outlook.com','hotmail.com','icloud.com')
- The free-email exclusion list from §1.5's "account matching by domain" paragraph, written directly into the query: these domains are shared by unrelated people at different companies, so rolling them up "by domain" would incorrectly merge strangers into one fake giant account.
1.6 Reverse ETL and data activation
Reverse ETL moves modelled data from the warehouse back into operational tools. The term became common around 2020–2021 as vendors such as Census and Hightouch defined the category; it is also called data activation. Its purpose is to make warehouse-derived intelligence (product usage scores, lifetime value, health scores, lead scores) available inside the systems where people act: the CRM, the marketing automation platform, the support desk, ad platforms.
How a sync works
A reverse ETL sync has four elements: a model (a query defining the rows to send), a primary key (identifying each row), a destination object (for example HubSpot companies) with a match key (for example company domain), and a field mapping. On each run the tool computes the difference between the current query result and the previous run (change data capture at the model level) and sends only new or changed rows, which respects destination API rate limits. Sync behaviours include update only (modify existing records), upsert (update or create) and mirror (also delete records no longer in the model). Update-only is the safe default during development because it cannot create junk records.
Governance risks
Reverse ETL writes into production systems used by customer-facing staff, so errors propagate quickly. Common failure modes include overwriting fields that humans maintain manually, creating duplicates when match keys are inconsistent, and flooding destinations with field updates that trigger automation (for example, workflows that fire on every field change). Mitigations include field-level ownership (each CRM field is owned either by humans or by the warehouse, never both), staged rollouts on a subset of records, and monitoring of sync error rates.
1.7 Warehouse-native architecture
Two architectural philosophies compete. In the application-centric model, a packaged tool such as a customer data platform (CDP) or the CRM itself is the system of record, holding its own copy of customer data and its own logic. In the warehouse-native (or "composable") model, the warehouse is the single source of truth and tools read from it directly or receive data from it, so business logic is defined once in SQL and reused everywhere. The warehouse-native approach reduces duplication and lock-in and makes definitions consistent across tools, at the cost of requiring data engineering capability. Packaged tools remain simpler for teams without that capability. The trend in data-mature organisations has been toward the composable model, which is why many CDPs and marketing platforms now offer warehouse-native options.
dim_accounts mart containing is_paying, active_users and plan, and synced those three fields to CRM accounts with update-only semantics. Sequencing tools were configured to exclude accounts where is_paying was true. Complaints from existing customers about sales outreach stopped within a month, and account executives began using active_users to identify expansion opportunities: a retention and expansion benefit that the project had not originally targeted.Lecture summary
- Fragmented data across operational tools causes misinformed action and conflicting reports; a governed single source of truth resolves this.
- The modern data stack separates ingestion, storage, transformation, activation and consumption; ELT became dominant because cloud warehouses made in-warehouse transformation cheaper and more flexible.
- Dimensional modelling organises data into facts and dimensions at declared grains; slowly changing dimensions preserve history where attributes change.
- dbt brings dependency management, testing and version control to SQL; staging, intermediate and mart layers localise change.
- Identity resolution combines deterministic and probabilistic matching; false positives and false negatives carry different costs and require different controls.
- Reverse ETL activates warehouse data in operational tools; sync semantics, field ownership and staged rollout manage its risks.
Review and discussion questions
- Explain why the shift from ETL to ELT followed from the economics of cloud data warehouses.
- Define grain. What is the grain of a table of opportunity stage changes, and of a table of accounts?
- An account moves from SMB to mid-market in June. Explain how Type 1 and Type 2 slowly changing dimensions would report that account's revenue for January.
- Compare deterministic and probabilistic identity resolution, and argue which errors are more harmful in a customer-success context.
- Why should reverse ETL syncs begin in update-only mode? Describe a failure that upsert could cause.
- Discuss the trade-offs between a warehouse-native architecture and a packaged CDP for a 50-person startup.
Further reading
- Ralph Kimball and Margy Ross, The Data Warehouse Toolkit (3rd ed., 2013).
- dbt Labs, "How we structure our dbt projects" (docs.getdbt.com): the staging, intermediate and marts convention.
- I. P. Fellegi and A. B. Sunter, "A Theory for Record Linkage", Journal of the American Statistical Association (1969).
- Martin Kleppmann, Designing Data-Intensive Applications (2017): data systems, replication and consistency.
- Hightouch and Census documentation on sync modes and match keys.
In one sentence
Copy data from every tool into one warehouse, clean and join it so each customer has one correct record, then send that record back out to every tool.
The big idea
A normal company has customer data in many places. The CRM (HubSpot or Salesforce) knows about deals. The product database knows who logs in. Stripe knows who pays. The website knows who visited. None of them agree with each other.
So a sales rep opens the CRM and sees "free user". But Stripe says that same company pays $2,000 a month. The rep sends a silly email. The customer is annoyed. This is the problem stage 1 fixes.
Words you must know
- Data warehouse
- A big database built for analysis. Snowflake, BigQuery and Databricks are the common ones.
- ETL / ELT
- Extract, Transform, Load. Copy data out of apps into the warehouse. ELT means you load first and clean later inside the warehouse.
- Reverse ETL
- The opposite direction: send clean warehouse data back into apps like the CRM, ads or email tools.
- dbt
- A tool where you write SQL files ("models") that turn raw tables into clean tables, with tests.
- Identity resolution
- Working out that "Ada@Acme.com", "ada@acme.com " and user #4471 are the same person.
- Golden record
- The final, merged, best version of one person or company after identity resolution.
- Single source of truth
- The one place everyone agrees is correct. In this setup, the warehouse.
- Warehouse-native
- Tools that read straight from your warehouse instead of keeping their own copy of the data.
How it works, step by step
- Ingest. A connector copies raw tables from each app into the warehouse every hour or so. You do not clean anything yet.
- Stage. You write "staging" models that tidy each raw table: lower-case emails, rename columns, fix dates.
- Resolve identities. You match records across sources using keys like email, then email domain, then company name.
- Build marts. You build final tables like
dim_accountsanddim_contacts. These are the golden records. - Test. dbt checks that IDs are unique and nothing important is empty. Bad data never reaches sales.
- Activate. Reverse ETL syncs chosen columns (like "product usage score" or "paying customer: yes") into the CRM on a schedule.
Practical labs
Set up a free warehouse and load messy data
- Go to
console.cloud.google.com/bigqueryand sign in with a Google account. Create a new project. The sandbox lets you start without a card. - In the Explorer panel, click the three dots beside your project, then Create dataset. Name it
gtm_lab. - Open a new query tab, paste the SQL below and click Run. It creates three tables that disagree with each other on purpose, like real company data.
create or replace table gtm_lab.crm_contacts as
select * from unnest([
struct('Ada@Acme.com ' as email, 'Ada' as first_name, 'Acme Inc' as company, 'lead' as stage),
struct('tunde@globex.io', 'Tunde', 'Globex', 'opportunity'),
struct('mary.k@gmail.com', 'Mary', 'Initech', 'lead')
]);
create or replace table gtm_lab.app_users as
select * from unnest([
struct(101 as user_id, 'ada@acme.com' as email, 42 as logins_30d, date '2026-09-02' as signup_date),
struct(102, 'bola@acme.com', 17, date '2026-09-10'),
struct(103, 'mary.k@gmail.com', 3, date '2026-10-01')
]);
create or replace table gtm_lab.stripe_customers as
select * from unnest([
struct('cus_A1' as customer_id, 'billing@acme.com' as email, 2000 as mrr_usd),
struct('cus_G7', 'TUNDE@GLOBEX.IO', 0)
]);
What you should see: three new tables under gtm_lab. Click each one, then Preview. Notice the spaces, capital letters and the gmail address.
Resolve identities and build a golden record
- Normalise the key. Emails must be trimmed and lower-cased before you match them. Otherwise "Ada@Acme.com " and "ada@acme.com" look different.
- Get the domain. The part after @ tells you the company. But free domains like gmail.com do not, so you exclude them.
- Roll up to accounts. Group people by domain to get one row per company. Paste and run:
with people as (
select lower(trim(email)) as email, 'crm' as src from gtm_lab.crm_contacts
union all select lower(trim(email)), 'app' from gtm_lab.app_users
union all select lower(trim(email)), 'stripe' from gtm_lab.stripe_customers
),
domains as ( -- one row per email domain, counting distinct people
select split(email, '@')[offset(1)] as domain, count(distinct email) as known_people
from people group by 1
),
usage as ( -- product usage rolled up by domain
select split(lower(trim(email)), '@')[offset(1)] as domain, sum(logins_30d) as logins_30d
from gtm_lab.app_users group by 1
),
billing as ( -- revenue rolled up by domain
select split(lower(trim(email)), '@')[offset(1)] as domain, sum(mrr_usd) as mrr_usd
from gtm_lab.stripe_customers group by 1
)
select d.domain, d.known_people, u.logins_30d, b.mrr_usd
from domains d
left join usage u using (domain)
left join billing b using (domain)
where d.domain not in ('gmail.com','yahoo.com','outlook.com','hotmail.com','icloud.com')
order by b.mrr_usd desc nulls last;
What you should see: acme.com with 3 people, 59 logins and $2,000 MRR. globex.io with 1 person. gmail.com is gone. You just found that Acme is a paying, active account, even though the CRM still calls Ada a "lead".
Why this matters: that one mismatch is exactly the kind of insight a GTM engineer is paid to find and fix.
Turn your SQL into a tested dbt project
- Install the Google Cloud CLI (dbt uses it to log in to BigQuery). Download it from
cloud.google.com/sdk/docs/installand install with the defaults. Then close and reopen Git Bash. - Log in. Run this; a browser window opens. Choose the same Google account you used for BigQuery and click Allow:
gcloud auth application-default login
- Install dbt in a private Python environment inside your lab folder:
cd ~/gtm-labs
python -m venv .venv
source .venv/Scripts/activate # Windows Git Bash
# source .venv/bin/activate # Mac: use this line instead
pip install dbt-bigquery
- Create the dbt project: run
dbt init gtm_dbtand answer its questions like this. Your project ID is shown at the top of the BigQuery console, next to the Google Cloud logo.
| dbt asks | You answer |
|---|---|
| Which database would you like to use? | the number next to bigquery |
| Desired authentication method | the number next to oauth |
| project (GCP project id) | your project ID, e.g. gtm-lab-123456 |
| dataset (the name of your dbt dataset) | dbt_dev (dbt creates its tables here) |
| threads | 1 |
| job_execution_timeout_seconds | press Enter |
| Desired location | the number next to US |
- Go into the project, open it in VS Code and test the connection. Delete the
models/examplefolder that dbt created; you will not need it.
cd gtm_dbt
code .
dbt debug # should end with "All checks passed!"
- In VS Code, inside the
modelsfolder, create two folders:stagingandmarts. Then create the five files below, pasting each box into the file named above it. - File
models/staging/sources.ymltells dbt where your raw tables from Lab 1.1 live:
version: 2
sources:
- name: raw
schema: gtm_lab
tables:
- name: crm_contacts
- name: app_users
- name: stripe_customers
- File
models/staging/stg_app_users.sqlcleans the product users:
select
user_id,
lower(trim(email)) as email,
split(lower(trim(email)), '@')[offset(1)] as email_domain,
logins_30d,
signup_date
from {{ source('raw', 'app_users') }}
- File
models/staging/stg_stripe_customers.sqlcleans the billing records:
select
customer_id,
lower(trim(email)) as email,
split(lower(trim(email)), '@')[offset(1)] as email_domain,
mrr_usd
from {{ source('raw', 'stripe_customers') }}
- File
models/marts/dim_accounts.sqlbuilds one golden row per company.ref()tells dbt to build the staging models first:
with usage as (
select email_domain, count(*) as active_users, sum(logins_30d) as logins_30d
from {{ ref('stg_app_users') }} group by 1
),
billing as (
select email_domain, sum(mrr_usd) as mrr_usd
from {{ ref('stg_stripe_customers') }} group by 1
)
select
coalesce(u.email_domain, b.email_domain) as account_domain,
coalesce(u.active_users, 0) as active_users,
coalesce(u.logins_30d, 0) as logins_30d,
coalesce(b.mrr_usd, 0) as mrr_usd,
coalesce(b.mrr_usd, 0) > 0 as is_paying
from usage u
full outer join billing b on u.email_domain = b.email_domain
where coalesce(u.email_domain, b.email_domain)
not in ('gmail.com','yahoo.com','outlook.com','hotmail.com')
- File
models/marts/schema.ymladds tests:
version: 2
models:
- name: dim_accounts
columns:
- name: account_domain
tests: [unique, not_null]
- Save every file, then build and test in the terminal (still inside
gtm_dbt):
dbt run # builds stg_app_users, stg_stripe_customers and dim_accounts
dbt test # checks account_domain is unique and never empty
What you should see: Completed successfully after dbt run, and PASS twice after dbt test. In BigQuery, a new dataset dbt_dev appears with your three models. Click dim_accounts → Preview: acme.com shows 59 logins and $2,000 MRR. Next time you open a terminal, run source .venv/Scripts/activate again before using dbt.
Sync the golden record into a CRM (Reverse ETL)
- Set up HubSpot. Create a free account at
hubspot.com. Go to Settings (gear icon) → Properties, choose Company properties, and click Create property twice:logins_30d(type: Number) andis_paying(type: Single checkbox). - Add a test company. In HubSpot, go to CRM → Companies → Create company, and enter the domain
acme.com. - Create a key Hightouch can use to read BigQuery. In
console.cloud.google.com, go to IAM & Admin → Service Accounts → Create service account. Name ithightouch-reader, give it the roles BigQuery Data Viewer and BigQuery Job User, and click Done. Open it, go to Keys → Add key → Create new key → JSON. A file downloads; keep it private. - Connect Hightouch to BigQuery. Sign up at
hightouch.com. Go to Sources → Add source → BigQuery, enter your project ID, and upload the JSON key file. - Create a model. Go to Models → Add model, choose your BigQuery source and SQL query, and enter
select * from dbt_dev.dim_accounts. Set the primary key toaccount_domain. - Connect HubSpot. Go to Destinations → Add destination → HubSpot and log in to allow access.
- Create the sync. Go to Syncs → Add sync, choose your model and HubSpot, and pick the Companies object. Choose Update only (never create records while testing). Match Company domain name to
account_domain. Maplogins_30d→ logins_30d andis_paying→ is_paying. - Click Run. After it succeeds, set the schedule to every hour.
What you should see: open Acme in HubSpot; the new fields show 59 logins and paying: yes. Sales can now see product and billing truth without leaving the CRM. If Hightouch shows "0 rows updated", check that the HubSpot company's domain is exactly acme.com.
Common mistakes
- Matching on raw emails without lower-casing and trimming them first.
- Grouping gmail.com users into one giant fake "company".
- Letting reverse ETL create new CRM records before you trust the data. Start with update-only.
- Syncing 80 columns. Sync the 5 fields a rep will actually use.
- No tests. One duplicated ID can double every revenue number downstream.
Tools in 2026
| Job | Common tools | Note |
|---|---|---|
| Warehouse | Snowflake, BigQuery, Databricks, Postgres for small teams | BigQuery is easiest to start free |
| Ingest (ELT) | Fivetran, Airbyte, Stitch | Airbyte has an open-source version |
| Transform | dbt (Core is free), SQLMesh | dbt is the job-market standard |
| Reverse ETL | Hightouch, Census (Fivetran), Polytomic | Also called "data activation" |
Proof of work
Customer 360 starter kit
- A public GitHub repo with your dbt project, sources, staging models,
dim_accountsand tests. - A README with a diagram of the flow above and one screenshot of the synced CRM field.
- A 3-minute Loom: "I found a paying customer the CRM thought was a lead."
Check yourself
Stage checklist
Stage 02 · Foundation
Signal & Intent Routing
Catch the moments when a company is likely to buy, and get that alert to the right salesperson within minutes.
Learning outcomes
By the end of this lecture you should be able to:
- Define a buying signal and classify signals as fit, intent or timing, and as first-, second- or third-party.
- Explain how website de-anonymisation and third-party intent data are produced, and assess their accuracy limits.
- Explain the evidence on speed-to-lead and its implications for routing design.
- Describe event-driven architecture and the delivery guarantees of webhooks.
- Design a router that validates, deduplicates, enriches, scores and routes signals reliably.
- Apply alert-design principles that sustain human attention and avoid alert fatigue.
Prerequisites: Lecture 1, Lecture B (HTTP, idempotency). Reading time: about 50 minutes, plus 8 hours of labs.
Lecture notes
Lecture 2: Signal and Intent Routing
2.1 Signals: definition and taxonomy
A signal is an observable data point that changes the estimated probability or timing of a purchase. The concept rests on a simple observation about B2B buying: companies are in an active buying cycle for any given category only a small fraction of the time. Outreach that reaches an account during that window competes with fewer alternatives and meets a buyer already motivated to act. Signal-based GTM attempts to detect the window rather than to contact the whole market continuously.
Signals can be classified along two dimensions. By meaning:
- Fit signals indicate whether an account resembles the ICP (industry, size, technology stack). They change slowly.
- Intent signals indicate active research or evaluation (pricing page visits, competitor comparisons, review-site activity).
- Timing or trigger signals indicate an event that creates a need or a budget (funding, leadership change, new hiring, expansion, a regulatory deadline).
By source: first-party signals originate in the seller's own properties (website, product, emails, events) and are the most reliable and the most timely; second-party signals come from a partner's first-party data shared by agreement (for example a review platform reporting who viewed your category); third-party signals are aggregated by data vendors from sources the seller does not control.
2.2 Website de-anonymisation
Most website visitors never submit a form. De-anonymisation (visitor identification) attempts to identify them. Company-level identification uses reverse IP lookup: the visitor's IP address is matched to databases associating IP ranges with organisations. It works well for traffic from corporate networks, but accuracy declined as remote work moved traffic onto residential internet providers and mobile networks, whose addresses map to the provider, not the employer. Vendors supplement IP data with other signals, but match rates vary widely by audience.
Person-level identification, offered by vendors such as RB2B for United States traffic, matches visitors to individual profiles using identity networks and cookie or device data. Vendors themselves describe match rates in the range of roughly 30–45% of eligible US visitors, and observed rates are often lower. Person-level identification raises significant privacy questions: in the European Union and United Kingdom, identifying an individual from browsing behaviour without a lawful basis and appropriate notice is constrained by GDPR and ePrivacy rules. The HubSpot acquisition of Clearbit and its absorption into Breeze Intelligence illustrates how this capability is consolidating into larger platforms.
2.3 Third-party intent data
Third-party intent providers infer research behaviour from activity across many websites. Bombora, for example, operates a data cooperative of B2B publishers whose consumption data is aggregated by company and topic; when an organisation's consumption of a topic rises significantly above its own baseline, the provider reports a surge. Review platforms such as G2 report which organisations viewed a product category, a product's profile or comparison pages. Intent platforms such as 6sense combine several sources with predictive models to estimate buying stage.
Third-party intent has known limitations. It is probabilistic: a surge indicates elevated research by someone at the company, not a decision. It is coarse: it rarely identifies the individual or the purpose. It is delayed: aggregation windows mean the signal may describe last week. And it is shared: competitors buying the same data see the same surges. It is therefore most useful as a prioritisation input combined with first-party evidence, not as a standalone trigger for outreach.
2.4 Why timing matters: speed-to-lead
The case for real-time routing rests on evidence that response speed affects conversion. The most cited study, "The Short Life of Online Sales Leads" (Oldroyd, McElheran and Elkington, Harvard Business Review, March 2011), analysed lead response across more than two thousand US companies. It found that firms that attempted contact within an hour of an inquiry were nearly seven times as likely to qualify the lead as those that waited even one hour longer, and that average response times were far slower than that. The mechanism is intuitive: a buyer who has just acted is attentive and has not yet engaged a competitor; interest decays quickly. The design implication is that signal pipelines should be event-driven (react as events occur) rather than batch (process overnight) wherever a human response is expected.
2.5 Event-driven architecture and webhooks
In an event-driven architecture, systems publish notifications of state changes (events) to which other systems react. The two integration patterns are polling, in which the consumer repeatedly asks the producer for changes, and push, in which the producer sends events as they occur. Webhooks are the most common push mechanism in SaaS: the producer sends an HTTP POST containing a JSON payload to a URL the consumer has registered.
Delivery guarantees
Webhook producers almost universally provide at-least-once delivery: if the consumer does not respond with a 2xx status quickly, the producer retries, typically with exponential backoff over hours or days. The consequence is that a consumer will sometimes receive the same event more than once, and events may arrive out of order. Consumers must therefore be idempotent: they record a unique event identifier and ignore repeats. They should also acknowledge receipt quickly (return 200) and perform slow work, such as enrichment, asynchronously, so that slow processing does not trigger producer retries.
Authenticity
A webhook URL is publicly reachable, so anyone who discovers it can send forged events. Producers address this by signing payloads: they compute a hash-based message authentication code (HMAC) of the body using a shared secret and send it in a header (Stripe uses Stripe-Signature; GitHub uses X-Hub-Signature-256). The consumer recomputes the signature and rejects mismatches. Signatures commonly include a timestamp so that old, captured requests cannot be replayed.
Events that repeatedly fail processing should be moved to a dead-letter queue for inspection rather than retried indefinitely or silently dropped.
2.6 Designing the signal router
A signal router transforms raw events into actions. A robust design has six stages:
- Validate: verify the signature and schema; reject malformed or forged events.
- Deduplicate: discard events whose identifier has already been processed.
- Filter: drop events from excluded populations (competitors, students, personal email domains, existing customers for acquisition plays, unsupported regions).
- Enrich: add missing context: firmographics, CRM ownership, open opportunities, recent activity.
- Score: combine fit, intent and timing into a priority. Simple additive scores are transparent and adequate at first; weights should later be calibrated against outcomes (Lecture 4).
- Route and act: select the owner (by territory, account ownership or round-robin), select the channel, and generate a message that states the reason and the recommended next step.
- const seen = new Set();
- Implements the deduplicate stage directly: a
Setholds every event identifier already processed, and checking membership is how the "at-least-once delivery means repeats will arrive" fact from §2.5 gets turned into actual idempotent behaviour. The in-memory limitation is called out explicitly in the lab: a serverless Worker's memory is not guaranteed to persist between invocations, which is exactly why production systems move this set into Cloudflare KV or a database — the theory (idempotent consumers need durable state) and the lab's own caveat are the same point. - if (seen.has(v.event_id)) return Response.json({ ok: true, skipped: 'duplicate' });
- Returns a normal 200 success response even for a duplicate — this matters because of §2.5's point that producers retry on anything other than a 2xx: responding with an error for a duplicate would cause the producer to keep retrying something that was already handled correctly, when the correct behaviour is to accept it, silently discard it, and move on.
- if (BLOCKED_DOMAINS.includes(v.domain)) return Response.json({ ok: true, skipped: 'blocked' });
- Implements the filter stage — excluded domains (competitors, free email providers) are dropped here, after dedupe and before scoring, exactly matching the six-stage order in §2.6: there is no point scoring a visit that will be filtered out anyway.
- function score(v) { let s = 0; if (v.page === '/pricing') s += 30; ... }
- The additive scoring function implementing the score stage — each condition corresponds exactly to one line of the worked example above: pricing-page, repeated visits, ICP-fitting employee count, and target-market country each contribute independent points, which is what "simple additive scores are transparent" in §2.6 means concretely: anyone can read this function top to bottom and see exactly why a given visit scored what it scored.
- if (s >= 70) { ... await fetch(env.SLACK_WEBHOOK_URL, ...) }
- The route and act stage: the threshold check gates the final action, and
env.SLACK_WEBHOOK_URLis read from Cloudflare's encrypted secret store (set viawrangler secret put) rather than being written into the source file — the same "secrets live in the environment, not in code" discipline from Lecture B.2, now implemented in a serverless runtime instead of a local script.
2.7 Alert design and alert fatigue
The effectiveness of a routing system is limited by human attention. Alert fatigue, a term from clinical and operations settings, describes the declining responsiveness that follows exposure to frequent, low-value alerts. When most alerts do not lead to useful action, recipients learn to ignore all of them, including the important ones. Principles that sustain attention include: high thresholds (fewer, better alerts); actionability (every alert states why it fired and what to do); ownership (each alert has one named recipient); suppression of duplicates within a time window; and feedback (recipients can mark an alert as useful or not, which provides data to tune thresholds). The appropriate metric for a router is not the number of alerts sent but the conversion of alerts into meetings and pipeline.
Lecture summary
- Signals estimate who fits, whether they are evaluating, and when to engage; strong rules combine at least two of these.
- First-party signals are the most reliable; third-party intent is probabilistic, coarse, delayed and shared, so it is best used for prioritisation.
- De-anonymisation works at company level through reverse IP and at person level in the US through identity networks; both have accuracy and privacy limits.
- Evidence on speed-to-lead justifies event-driven rather than batch routing for human follow-up.
- Webhooks deliver at least once and can be forged; consumers must be idempotent, fast to acknowledge and signature-verifying.
- A router validates, deduplicates, filters, enriches, scores and routes; its success is measured by conversion, not alert volume.
Review and discussion questions
- Classify each as fit, intent or timing: a new CFO; a G2 comparison-page view; 300 employees; HubSpot in the tech stack; a Series B announcement.
- Why did remote work reduce the accuracy of reverse IP lookup?
- Explain at-least-once delivery and describe the consumer behaviour it requires.
- How does HMAC signing prevent forged webhook events? Why include a timestamp?
- Design a scoring rule for a product sold to e-commerce companies. Justify each weight.
- Discuss how you would measure whether a signal router is improving revenue rather than activity.
Further reading
- J. B. Oldroyd, K. McElheran and D. Elkington, "The Short Life of Online Sales Leads", Harvard Business Review (March 2011).
- Stripe documentation, "Receive Stripe events in your webhook endpoint": signature verification and retries.
- Gregor Hohpe and Bobby Woolf, Enterprise Integration Patterns (2003): messaging, idempotent receivers and dead-letter channels.
- Bombora and G2 documentation on how intent signals are generated.
In one sentence
When something happens that suggests a company wants to buy, a webhook sends the details to a small program that checks, scores and forwards it to the right person fast.
The big idea
Timing beats everything in sales. The same email sent the week a company raised money, hired a new sales leader or visited your pricing page three times gets far more replies than the same email sent on a random Tuesday.
A signal is any clue about timing. Your job is to collect signals, throw away the noise, score what is left and route it. Routing means: send it to the person who owns that account, in the place they already work (usually Slack or the CRM).
Words you must know
- Signal
- A data point that suggests buying interest or good timing.
- First-party intent
- Signals from your own assets: site visits, pricing page, docs, product sign-ups.
- Third-party intent
- Signals bought from data vendors, like a company reading many articles on a topic around the web (Bombora, G2, 6sense).
- Deanonymization
- Turning an anonymous website visit into a company (reverse IP lookup) or, in some countries, a person.
- Webhook
- An automatic HTTP POST message one app sends to a URL you choose when something happens.
- Payload
- The data inside the webhook, usually JSON.
- Router
- Your logic that decides: keep or drop, how hot, and who gets it.
- Speed-to-lead
- Minutes between the signal and a human acting on it. Lower is better.
- Idempotency
- Handling the same event twice without doing the action twice. Stops duplicate alerts.
How it works, step by step
- Detect. A tool notices an event, such as "Globex visited /pricing".
- Send. It POSTs a JSON payload to your webhook URL.
- Filter. Your router drops students, competitors, existing customers and countries you do not sell to.
- Enrich. It adds missing facts: company size, industry, who owns this account in the CRM.
- Score. It adds points for strong signals and fit. Below the threshold, it just logs.
- Route. Above the threshold, it posts to Slack with the reason and a suggested next step.
Buyer timing triggers
| Trigger | Where to find it | Why it means "now" |
|---|---|---|
| Pricing page visited 3+ times in 7 days | Visitor ID tool, product analytics | They are comparing costs |
| New funding round | Crunchbase, news, Clay | New budget, pressure to grow |
| New VP of Sales / RevOps hired | LinkedIn, job-change data | New leaders buy new tools in their first 90 days |
| Hiring SDRs or GTM engineers | Job boards, Sumble, Clay | They are investing in the problem you solve |
| Champion changed jobs | Job-change tracking on your past users | A fan of your product is at a new company |
| Started using a related tool | Technographic data (BuiltWith, Sumble) | Your product fits their new stack |
| Reviewing competitors | G2 Buyer Intent | Actively shopping |
Practical labs
Catch your first webhook
- Open
webhook.sitein your browser. It gives you a unique URL right away. Click Copy next to "Your unique URL". Leave this tab open. - Open Git Bash (Windows) or Terminal (Mac).
- Copy the command below into VS Code or Notepad first, replace
YOUR-UNIQUE-IDwith your URL's ending, then paste it into the terminal and press Enter:
curl -X POST "https://webhook.site/YOUR-UNIQUE-ID" \
-H "Content-Type: application/json" \
-d '{
"event_id": "evt_0001",
"company": "Globex",
"domain": "globex.io",
"employees": 180,
"country": "US",
"page": "/pricing",
"visits_7d": 3
}'
- Go back to the webhook.site tab and click the new request on the left.
What you should see: the request with its headers and your JSON body under "Raw Content". This is exactly what tools like RB2B, HubSpot or Typeform send you. Note: these multi-line commands work in Git Bash and Mac Terminal, not in Windows Command Prompt.
Post an alert into Slack
- Create a free Slack workspace at
slack.com/get-started(or use one where you are allowed to add apps). - In Slack, create a channel called
#hot-signals. - Go to
api.slack.com/apps→ Create New App → From scratch. Name it "Signal Router", pick your workspace, and click Create App. - In the left menu, click Incoming Webhooks, switch it On, click Add New Webhook to Workspace, choose
#hot-signalsand click Allow. - Copy the Webhook URL (it starts with
https://hooks.slack.com/services/). Treat it like a password. - In Git Bash/Terminal, replace the URL below with yours and run it:
curl -X POST "https://hooks.slack.com/services/XXX/YYY/ZZZ" \
-H "Content-Type: application/json" \
-d '{"text":"Hot signal: Globex (180 staff, US) viewed /pricing 3 times this week. Owner: Tunde. Next step: send the pricing FAQ."}'
What you should see: the terminal prints ok and the message appears in #hot-signals. Save the webhook URL somewhere private; Lab 2.3 uses it.
Build a real router with scoring and dedupe
- Create a free Cloudflare account at
dash.cloudflare.com/sign-up. - In the terminal, create the project:
cd ~/gtm-labs
npm create cloudflare@latest signal-router
- Answer the questions with the arrow keys and Enter: Hello World example → Worker only → JavaScript → git: No → deploy now: No.
- Open the project:
cd signal-router, thencode . - In VS Code, open
src/index.js, delete everything in it, and paste this:
const BLOCKED_DOMAINS = ['gmail.com', 'yahoo.com', 'competitor.com'];
const seen = new Set(); // simple dedupe; use KV or a database in production
function score(v) {
let s = 0;
if (v.page === '/pricing') s += 30; // strong buying page
if (v.page?.startsWith('/docs')) s += 10; // evaluating
if (v.visits_7d >= 3) s += 25; // repeated interest
if (v.employees >= 50 && v.employees <= 1000) s += 25; // fits ICP size
if (['US', 'CA', 'GB'].includes(v.country)) s += 20; // a market we sell to
return s;
}
export default {
async fetch(request, env) {
if (request.method !== 'POST') return new Response('Send a POST', { status: 405 });
const v = await request.json();
if (seen.has(v.event_id)) return Response.json({ ok: true, skipped: 'duplicate' });
seen.add(v.event_id);
if (BLOCKED_DOMAINS.includes(v.domain)) return Response.json({ ok: true, skipped: 'blocked' });
const s = score(v);
if (s >= 70) {
const text = `Hot signal (${s}/100): ${v.company} (${v.employees} staff, ${v.country}) ` +
`viewed ${v.page} ${v.visits_7d}x this week. Next step: personal note + pricing FAQ.`;
await fetch(env.SLACK_WEBHOOK_URL, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text })
});
}
return Response.json({ ok: true, score: s, routed: s >= 70 });
}
};
- Save the file. In the terminal, log in to Cloudflare (a browser opens; click Allow), then deploy:
npx wrangler login
npx wrangler deploy
- Copy the URL it prints, like
https://signal-router.YOURNAME.workers.dev. - Add your Slack webhook as a secret, so it never sits in your code. Run this and paste the Slack URL from Lab 2.2 when asked:
npx wrangler secret put SLACK_WEBHOOK_URL
- Test it three ways. Replace the URL with yours and run each command:
# 1. A hot signal: should post to Slack
curl -X POST "https://signal-router.YOURNAME.workers.dev" -H "Content-Type: application/json" \
-d '{"event_id":"evt_0001","company":"Globex","domain":"globex.io","employees":180,"country":"US","page":"/pricing","visits_7d":3}'
# 2. The same event again: should be skipped as a duplicate
curl -X POST "https://signal-router.YOURNAME.workers.dev" -H "Content-Type: application/json" \
-d '{"event_id":"evt_0001","company":"Globex","domain":"globex.io","employees":180,"country":"US","page":"/pricing","visits_7d":3}'
# 3. A gmail visitor: should be blocked
curl -X POST "https://signal-router.YOURNAME.workers.dev" -H "Content-Type: application/json" \
-d '{"event_id":"evt_0002","company":"Someone","domain":"gmail.com","employees":1,"country":"US","page":"/pricing","visits_7d":5}'
What you should see: test 1 returns {"ok":true,"score":100,"routed":true} and a message appears in Slack. Test 2 returns "skipped":"duplicate". Test 3 returns "skipped":"blocked". If test 2 is not skipped, Cloudflare started a fresh copy of your Worker, which empties the memory; that is why real systems store seen IDs in Cloudflare KV.
Level up: look up the account owner from your CRM API and @mention them. Add a "Mark as handled" button using Slack Block Kit.
The no-code version
- Sign up at
make.com. Click Create a new scenario. - Click the big +, search Webhooks, choose Custom webhook. Click Create a webhook, name it "site visits", save, and click Copy address to clipboard.
- Click Run once (bottom left) so Make listens. In Git Bash, send the Lab 2.1 command to this new address instead of webhook.site. Make shows "Successfully determined".
- Hover to the right of the webhook module, click Add another module, search HTTP and choose Make a request. Set URL = your Slack webhook URL, Method = POST, Body type = Raw, Content type = JSON, and Request content =
{"text":"Hot signal: {{company}} viewed {{page}} {{visits_7d}} times"}, clicking the blue fields from the webhook instead of typing the braces. - Click the line between the two modules, choose Set up a filter. Label it "Hot only". Condition 1: page · Text operators: Equal to ·
/pricing. Click Add AND rule. Condition 2: visits_7d · Numeric operators: Greater than or equal to ·3. - Click Run once again and resend the curl. Then change
visits_7dto 1 and send it again.
What you should see: the first request posts to Slack; the second stops at the filter (Make shows the bundle did not pass). Turn on the scenario with the ON/OFF switch to keep it running. Knowing both the code and no-code versions lets you pick the right one for each client.
Common mistakes
- Alerting on every visit. Reps learn to mute the channel within a week. Keep the threshold high.
- Alerts with no reason and no next step. Always say why it fired and what to do.
- No dedupe, so one company triggers 20 messages.
- Putting webhook URLs and API keys inside the code or a public repo.
- Treating a single third-party intent spike as proof. Combine at least two signals.
Proof of work
Live signal router
- Your Worker code on GitHub, with the scoring rules explained in the README.
- A screenshot of a real alert in Slack and of the duplicate being skipped.
- A one-page "signal playbook": 5 triggers, their points, and the message angle for each.
Check yourself
Stage checklist
Stage 03 · Create pipeline
Outbound Strategy & Infrastructure
Build the foundation of the outbound motion: the three layers of GTM engineering, segmentation and offer strategy, warmed sending infrastructure, and a verified, researched list — the machine the next stage runs on.
Learning outcomes
By the end of this lecture you should be able to:
- Explain the three layers of GTM engineering (research/strategy/data, outbound infrastructure, agents/RevOps) and the economics of outbound prospecting.
- Segment a TAM into an ICP, classify an offer using the four offer categories, and explain why cold outbound favors make-money offers over risk-reduction offers.
- Compute inbox, domain and reserve requirements for a sending target, and explain the deliverability math behind mailbox warmup.
- Explain email authentication (SPF, DKIM, DMARC) and the deliverability requirements of major mailbox providers.
- Compare three list-building methods on coverage, accuracy and cost, and explain why a raw pull must be qualified before enrichment.
- Design an LLM research pipeline that separates research, qualification and writing, and explain why separation improves reliability.
Prerequisites: Lectures A, B and 2. Reading time: about 50 minutes, plus 6–8 hours of labs.
Lecture notes
Lecture 3: Outbound Strategy and Infrastructure
3.1 The three layers of GTM engineering
Outbound prospecting is the seller-initiated creation of sales conversations with organisations that have not expressed interest. In the specialised sales model described by Aaron Ross in Predictable Revenue (2011), prospecting is assigned to sales development representatives (SDRs), whose output is qualified meetings for account executives. A GTM engineer automates and instruments this work. The work decomposes into three layers, each with its own failure modes: research, strategy and data (who to target, where they live, and getting accurate contact data for them); outbound infrastructure (the domains, inboxes, sequencers and dialers that reach them); and agents and RevOps (the systems that sort replies, score leads, route them to a rep and update the CRM). A system strong in one layer and weak in another fails at the weak layer regardless of how good the others are: a perfect offer sent from a burned domain never arrives, and a perfectly delivered email with no real offer never converts. This chapter builds all three, in the order that lets each one be tested against something real.
Outbound performance can still be decomposed into the conversion chain introduced in Lecture 2:
The chain shows why volume alone is a weak lever: each factor multiplies the others, and several (deliverability, reply rate) degrade when volume rises without corresponding relevance, because recipients and mailbox providers penalise irrelevant mail. Historically SDRs spent much of their time on research and drafting rather than conversation; the recurring pattern in this chapter is that AI produces a first version of each layer, and a person checks it before it runs at scale. That pattern is a direct consequence of §3.5's separation-of-concerns argument: a system that can inspect, score and correct an intermediate output is more reliable than one that cannot, whether the intermediate output is a research JSON object, a 500-row list, or a drafted email.
3.2 Strategy: segmentation, signals and the offer categories
Every outbound campaign answers two questions, and the order matters: who are we targeting, and what do we say to earn their interest. A total addressable market (TAM) is every organisation that could conceivably buy; an ideal customer profile (ICP) is the part of the TAM most likely to buy soon, at a profitable size, through a sales process that can reach it. Treating the whole TAM as one audience wastes sends on poor-fit accounts and buries the signal a tighter segment would show; §3.4's list-building methods all assume the ICP has already been narrowed.
An ICP is broken into segments by industry and sub-industry, because the signal that predicts fit in one sub-industry (a landscaping business outsourcing design work, §3.4) rarely transfers to another. Within a segment, fit signals commonly include headcount, the tools a company already uses, a newly hired head of a relevant function, open job postings, and recent funding. Each persona — the job title actually read and replied to — is measured on something at work, and that measurement is the pain the offer should speak to.
The four offer categories
Offers can be classified by the kind of value they promise: make money, save money, save time, or lower risk. In cold outbound specifically, make-money offers tend to outperform the other three, because a buyer can evaluate an upside claim without having first noticed a problem. Risk-reduction offers (cybersecurity, compliance, bookkeeping) are reported to be the hardest to sell cold, for the opposite reason: the buyer typically has to already perceive the risk as urgent before a cold message about it lands, and that perception is usually triggered by an event (an incident, an audit, a new regulation) rather than by outbound timing a seller controls. This is a claim about cold, unsolicited contact specifically — the same risk-reduction offer can convert well through inbound or event-triggered outbound, where the buyer's own timing signal (Lecture 2) has already done the work a cold message cannot.
Strategy as a chain of prompts
§3.5's separation-of-concerns principle applies above the level of a single email: strategy itself can be built as a chain of steps, each one a separate, inspectable artefact rather than one prompt that guesses an entire go-to-market plan at once. A workable chain is: deep research on the company; mapping the segments of its market; an ICP and personas for each segment; where to find data on that market; keywords to filter databases with; and first-draft messaging angles. Packaging this as a reusable instruction set — what §4.6 calls a skill — lets a company domain go in and a market map, candidate ICPs, offers to test and messaging angles come out in minutes rather than hours. The output is still a first draft: a segment that scores well on paper can be a poor real-world fit, and catching that is the judgement the human step exists to supply. A strategy chain with no review step quietly inherits whatever bias its scoring weights have.
3.3 Sending infrastructure and deliverability math
Nothing else in this chapter matters if the email lands in spam. Deliverability is the probability that a sent message reaches the recipient's inbox rather than the spam folder or a rejection, and mailbox providers decide it using three inputs: sender authentication, sender reputation, and recipient engagement.
Authentication
- SPF (Sender Policy Framework, RFC 7208) is a DNS record listing the servers authorised to send mail for a domain.
- DKIM (DomainKeys Identified Mail, RFC 6376) adds a cryptographic signature to each message, verifiable with a public key published in DNS, proving the message was not altered and was authorised by the domain.
- DMARC (RFC 7489) publishes the domain's policy for messages that fail SPF and DKIM alignment (
p=none,quarantineorreject) and an address for aggregate reports.
Provider requirements
Since February 2024, Google and Yahoo have required bulk senders (Google defines these as senders of more than 5,000 messages a day to Gmail addresses) to authenticate with SPF, DKIM and DMARC, to support one-click unsubscribe for marketing messages (RFC 8058), and to keep user-reported spam rates below 0.3%. Cold outreach programmes usually operate below the bulk threshold by design (see the inbox math below), but the same signals govern their reputation regardless.
Operational practice: domains, inboxes and the warmup math
Cold outreach is sent from secondary domains that resemble the primary domain, so reputation damage never touches the domain used for customer and transactional email. A newly created mailbox has no reputation at all, so it is warmed: volume is increased gradually on a fixed schedule rather than switched on at full speed. A commonly used schedule is a 14-day warmup starting at around 5 emails a day and adding roughly 1 a day up to about 20, followed by a cold ramp that starts the first real cold-sending day at around 5 a day and adds roughly 1 a day up to a steady-state ceiling of around 15. The ceiling is set low deliberately: a widely used operating range is 2 inboxes per sending domain and 15, at most 20, cold emails per inbox per day — far below the bulk-sender threshold above, which is the point.
A worked example: a target of 1,500 emails a day at 15 per inbox needs 100 inboxes, which at 2 inboxes per domain is 50 domains. Infrastructure also degrades and needs a buffer: a commonly used reserve is one spare inbox for every sending inbox, or at least 20% of total capacity, so an inbox taken offline for a reputation problem does not immediately cut the day's send volume. With a full reserve, the same 1,500-a-day target needs roughly 200 inboxes across 100 domains — double the bare minimum, held in readiness rather than idle.
Inboxes do not last indefinitely. A typical inbox lifespan is 3 to 6 months of healthy sending; a strong, well-targeted offer can extend this to 6 to 9 months, while a poor offer that generates spam complaints can burn an inbox out in about a month, because complaint rate — not send volume alone — is what providers treat as the leading reputation signal. This is the infrastructure-layer argument for everything in §4.1's offer design: a weak offer is not only less likely to convert, it is also more expensive to run, because it shortens the life of the sending infrastructure built to carry it.
Splitting by provider and reacting to bounces
Deliverability at Google, Microsoft/Outlook, security-gateway-protected domains (Mimecast, Proofpoint) and personal email providers is governed by different filtering logic, so campaigns are commonly split and monitored by receiving provider rather than treated as one audience; a problem isolated to one provider usually means a provider-specific deliverability issue, not a copy or list problem (§4.3's diagnostic table makes this explicit). Bounce rate is monitored per inbox and acted on at fixed thresholds: a widely used rule is to swap the sending inbox above a 3% bounce rate, and to stop sending, replace the inbox and re-check the list above 10%, because a bounce rate that high usually indicates a list-quality problem (§3.4) rather than an infrastructure problem alone.
3.4 List building: three methods and the coverage–accuracy–cost trade-off
The campaign is the list: most of an outbound engineer's time, and most of the difference between a campaign that books meetings and one that doesn't, is spent here rather than on copy. Prospecting begins with account selection (organisations matching the ICP, ideally carrying a timing signal from Lecture 2) followed by contact discovery (people in the target personas at those accounts). A tight list is narrowed to one segment, one group of similar job titles, and one employee-count range at a time; §4.1 and §4.2 return to why list tightness does a meaningful share of the work message-level personalisation is often asked to do instead.
Pull broad, then qualify
A raw database pull against firmographic filters alone typically lands only 50–60% true ICP fit, because filters describe the account on paper, not its actual present state. Two filter-selection rules follow from this: prefer keyword filters (text drawn from a company's own site or listings) over blunt industry-category filters, which are coarse and provider-defined; and prefer headcount over revenue as a size proxy, because private-company revenue figures inside most databases are largely estimated rather than reported, while headcount is more often directly observable (job listings, LinkedIn, company pages). Filters built on inferred buying intent, inferred headcount growth, website-traffic estimates and news mentions are reported to be frequently wrong inside general-purpose databases, and should be treated as a researched signal to verify, not a filter to trust blindly. Qualifying a company (confirming firmographic fit, often with an AI column reading its own website) should happen before paying to find people at it — enrichment applied before qualification wastes money and coverage attempts on accounts that would have been dropped anyway.
Enrichment and the waterfall
Enrichment appends attributes to a record: verified work email, title, seniority, department, company size, funding, technology stack and recent news. Data providers differ in coverage and accuracy by region, industry and company size, and B2B contact data decays continuously as people change jobs. Waterfall enrichment, popularised by Clay, queries providers in sequence, cheapest first, and stops at the first valid result; a common pattern finds 3 to 5 decision-makers per qualified company this way. It raises coverage (the share of records successfully enriched) while controlling cost, since later, usually pricier providers are queried only for records the earlier ones missed. Each found email should then be verified twice — once as a normal address, and once specifically for catch-all domains, which accept mail for any address at the domain and so return a false "valid" from a single pass — because bounces harm sender reputation (§3.3). The three objectives (coverage, accuracy, cost) trade off against each other: maximising coverage increases cost and the risk of lower-quality matches; minimising cost reduces coverage. A verified list is considered ready to send against once its measured bounce rate is under 2%. A phone number is enriched through its own waterfall, queried the same way and usually priced higher per match than email, and is worth running only for the subset of contacts a calling motion (§4.5) will actually use — enriching every row with a phone number regardless of whether anyone calls it wastes coverage budget for no benefit.
Three ways to build the same list
The same ICP can be turned into a contact list by three different routes, which trade automation for control:
- A database. General B2B data providers are filtered as above and exported. Fastest, cheapest per record, and the most exposed to the stale and inferred-filter problems described above.
- A Clay-built waterfall. Built by hand first, one AI column per yes/no question (for example, "is this a B2B SaaS company?", "does it have a live pricing page?") so the qualification logic is visible and testable before it is trusted to run unattended — the same separation-of-concerns argument as §3.5, applied to qualification instead of writing. One job per AI column is a deliberate constraint: a column asked three questions at once tends to answer all three worse than three columns asked one question each, because partial correctness in one no longer trips a visible failure. New columns are tested on 10 rows before running the full list, specifically because credits spent confirming a broken prompt at scale are not recoverable. An AI column returning blank or low-confidence answers is a signal to try a stronger model, not to accept the blank answer. The found emails are then run through an email-finder waterfall and verified twice as above.
- An agent connected to the data tools' APIs. §4.6 covers this route in full: an AI agent with its own access to the same provider APIs, given written step-by-step instructions, builds the list from a plain-English request. This is the fastest route once the instructions exist, but it inherits the limits of whatever the instructions tell it to do; it does not remove the need to have worked out the logic by hand once.
Beyond general databases
Some ICPs are poorly covered by general B2B databases. Specialised lookalike providers (tools built to find companies resembling a set of best customers) help here; so does Google Maps for local businesses with little LinkedIn presence, and general-purpose web scraping for industry directories no database has indexed.
3.5 Research automation with LLMs
Personalised outreach requires research: understanding what the company does, what has changed recently, and which problem the seller can credibly address. LLM agents (such as Clay's Claygent) can read websites, news and job postings and extract this information for each row. Reliable research pipelines share three properties, and the same discipline governs every automated step in this chapter, not research alone — see §3.2's strategy chain and §3.4's qualification columns.
Separation of concerns
Research, qualification and writing should be separate steps. A single prompt that reads raw webpages and writes an email conflates retrieval with composition; when the output is wrong it is impossible to tell whether the research or the writing failed, and the model is free to invent facts to make the email persuasive. Separating them produces an intermediate artefact, structured research, that can be inspected, scored and reused.
Structured, grounded extraction
The research step should return JSON with fixed fields (what the company sells, to whom, a specific growth signal, a likely pain, a confidence rating), should be restricted to the supplied text, and should return null when the text does not support a field. Confidence ratings allow the pipeline to route low-confidence rows to a generic message or to manual review instead of fabricating relevance.
- headers={"User-Agent": "research-bot (contact: you@yourdomain.com)"}
- Identifies the script honestly to the site being requested, including a real contact address — a basic scraping-etiquette norm (also referenced in the lab's "scrape responsibly" note) that lets a site owner identify and, if needed, contact or block the specific bot, rather than the request looking like an anonymous or disguised crawler.
- soup.find("meta", attrs={"name": "description"})
- BeautifulSoup's
findsearches the parsed HTML tree for the first tag matching both a tag name (meta) and an attribute value (name="description") — this is how the function retrieves the page's meta description specifically, rather than every meta tag on the page (of which there are usually many, for viewport settings, social-sharing cards, and so on). - desc["content"].strip() if desc and desc.get("content") else ""
- Two defensive checks chained together:
if descguards against the meta tag not existing at all (findreturnsNonein that case, and indexing intoNonewould crash), anddesc.get("content")(rather thandesc["content"]directly) guards against the tag existing but lacking a content attribute — returning an empty string in either failure case rather than letting the script crash on a page that is simply missing this one field. - [h.get_text(" ", strip=True) for h in soup.find_all(["h1", "h2"])][:8]
- A list comprehension (Lecture B.3's "shape of data" idea applied in Python):
find_allreturns every H1 and H2 tag on the page,get_text(" ", strip=True)extracts each one's visible text with internal whitespace collapsed to single spaces, and[:8]caps the result at the first 8 headings — a defensive limit against an unusually long page producing an unwieldy result.
The scraped facts feed directly into the research prompt's grounding instruction — "use ONLY the text below" — which is Lecture 8.5's grounded-extraction pattern (schema-constrained JSON, explicit instruction not to invent, null for unsupported fields) applied here to company research rather than call summarisation. The same three techniques, the same underlying hallucination risk, and the same fix.
Qualification
A qualification step decides, with stated reasons, whether the account should be contacted at all. Excluding poor-fit accounts is one of the cheapest ways to raise reply rates and protect deliverability.
Lecture summary
- GTM engineering has three layers — research/strategy/data, outbound infrastructure, and agents/RevOps — and a weak layer caps the system regardless of how strong the others are.
- Strategy starts with TAM/ICP segmentation and the four offer categories; make-money offers outperform risk-reduction offers in cold outbound specifically.
- Sending infrastructure follows explicit math: inboxes-per-domain, a 14-day warmup, a cold ramp, a reserve, a finite inbox lifespan, and bounce-rate action thresholds.
- Email authentication (SPF, DKIM, DMARC) and major-provider bulk-sender rules govern deliverability regardless of how good the list or copy is.
- List building trades coverage, accuracy and cost; a raw pull must be qualified before enrichment, and the same ICP built three different ways is worth comparing on cost and downstream result, not ease of assembly.
- Reliable LLM research pipelines separate research, qualification and writing, produce structured grounded output, and abstain when evidence is missing.
Review and discussion questions
- Name the three layers of GTM engineering and give one failure mode specific to each.
- Why do risk-reduction offers underperform make-money offers in cold outbound specifically, and under what channel conditions does that reverse?
- A team wants to send 3,000 cold emails a day. Using the inbox-math formulas, how many inboxes and domains do they need with a full reserve?
- Explain why a raw database pull must be qualified before enrichment, and why headcount is generally a more reliable size filter than revenue.
- Explain why separating research, qualification and writing into distinct LLM steps improves reliability over one combined prompt.
Further reading
- Aaron Ross and Marylou Tyler, Predictable Revenue (2011).
- Google Workspace Admin Help, "Email sender guidelines": requirements for bulk senders.
- RFC 7208 (SPF), RFC 6376 (DKIM), RFC 7489 (DMARC) and RFC 8058 (one-click unsubscribe).
- Clay University course material on waterfall enrichment and Claygent.
- Christian, GTM University (gtmu.io): the Level 1–7 outbound-engineering framework and the inbox/warmup math drawn on in this chapter are practitioner material from this source, cited here as applied industry practice alongside the academic citations above, not as peer-reviewed research.
In one sentence
Pick a segment and an offer before anything else, then build warmed sending infrastructure and a verified, researched list — the machine the next stage writes to and sends from.
The big idea
Most outbound systems fail before a single email is written: the wrong segment, an offer nobody wants, or sending infrastructure with no reputation to spend. A GTM engineer builds the foundation first — strategy, infrastructure, list — so that whatever gets written and sent in the next stage has somewhere real to land.
Words you must know
- ICP
- Ideal Customer Profile. The type of company you win most: industry, size, region, tech stack.
- TAM
- Total addressable market: every company that could ever buy, before narrowing to an ICP.
- Persona
- The type of person inside the ICP you talk to, such as "Head of RevOps".
- Enrichment
- Adding data to a record: job title, email, company size, recent news.
- Waterfall enrichment
- Asking provider A for an email; if it fails, asking B, then C. More coverage, fewer credits wasted.
- Claygent / AI column
- A Clay column where an AI agent browses the web or reads data to answer a question per row.
- Deliverability
- Whether your email lands in the inbox instead of spam.
- SPF, DKIM, DMARC
- Three DNS records that prove your emails are really from you. Without them, inboxes distrust you.
- Inbox warmup
- Slowly raising a new inbox's daily volume on a fixed schedule so mailbox providers trust it before it sends at full speed.
- Reserve inbox
- A spare, already-warmed inbox kept ready so a flagged inbox can be swapped out without losing send volume.
How it works, step by step
Try it · Inbox & warmup math
How many inboxes and domains do you need?
Practical labs
Call the Apollo API directly
- Sign up at
apollo.io. Go to Settings → Integrations → API, create an API key, and copy it. - In Git Bash/Terminal, save the key for this window:
export APOLLO_API_KEY="paste-your-key" - Test one enrichment with curl. The endpoint is
POST /api/v1/people/match:
curl -X POST "https://api.apollo.io/api/v1/people/match?first_name=Tim&last_name=Zheng&domain=apollo.io&reveal_personal_emails=false" \
-H "x-api-key: $APOLLO_API_KEY" \
-H "Content-Type: application/json" \
-H "Cache-Control: no-cache"
- Now do it in Python. In VS Code, create
apollo_enrich.pyingtm-labs, paste this and save:
import os, requests
def enrich(first, last, domain):
r = requests.post(
"https://api.apollo.io/api/v1/people/match",
headers={"x-api-key": os.environ["APOLLO_API_KEY"], "Content-Type": "application/json"},
params={"first_name": first, "last_name": last, "domain": domain,
"reveal_personal_emails": "false"},
timeout=30,
)
r.raise_for_status()
p = r.json().get("person") or {}
org = p.get("organization") or {}
return {
"name": p.get("name"),
"title": p.get("title"),
"email": p.get("email"),
"linkedin": p.get("linkedin_url"),
"company": org.get("name"),
"employees": org.get("estimated_num_employees"),
}
print(enrich("Tim", "Zheng", "apollo.io"))
- Run it in the same terminal window:
python apollo_enrich.py - Change the name and domain to a person at a company you know (public business info only) and run it again.
What you should see: a dictionary with name, title, email and company size. A 401 error means the key is wrong or not set in this window; a 403 can mean your Apollo plan does not include API access.
webhook_url you must provide.Scrape a company homepage, politely
- Make sure the libraries are installed (done in Lab S.2):
python -m pip install requests beautifulsoup4 - In VS Code, create
scrape_home.pyingtm-labs, paste this and save:
import sys, requests
from bs4 import BeautifulSoup
def homepage_facts(domain):
url = f"https://{domain}"
html = requests.get(url, timeout=20,
headers={"User-Agent": "research-bot (contact: you@yourdomain.com)"}).text
soup = BeautifulSoup(html, "html.parser")
desc = soup.find("meta", attrs={"name": "description"})
return {
"title": soup.title.string.strip() if soup.title and soup.title.string else "",
"description": desc["content"].strip() if desc and desc.get("content") else "",
"headings": [h.get_text(" ", strip=True) for h in soup.find_all(["h1", "h2"])][:8],
}
domain = sys.argv[1] if len(sys.argv) > 1 else "clay.com"
print(homepage_facts(domain))
- Run it:
python scrape_home.py. Then try other sites:python scrape_home.py stripe.com - Copy one result; you will feed it to the AI in Lab 3.4.
What you should see: the site's title, tagline and main headings. Some sites block simple scrapers or build pages with JavaScript, which gives empty results; that is normal. Tools like Firecrawl or Clay's scrapers handle those.
robots.txt, go slowly, do not scrape logged-in pages, and never scrape personal data you have no right to use.LLM enrichment that returns clean JSON
- Click Copy on the prompt below and paste it into a note.
- Replace each
{{ }}part with real data: the company name, the homepage text from Lab 3.3, one news headline and 2–3 job titles from their careers page. Write "none" where you have nothing. - Paste the finished prompt into Claude.ai and send it.
- Check the answer: exactly five keys, valid JSON, nothing invented. Then try a company where you give almost no text; it should return nulls instead of guesses.
- In Clay, add an AI column, paste the prompt, and replace each
{{ }}by typing / and picking the matching column. Set the output format to JSON and add the five fields. Run it on 5 rows.
You are a B2B research assistant. Use ONLY the text below. Do not guess.
Company: {{company_name}}
Website text: {{homepage_text}}
Recent news: {{news}}
Job posts: {{job_titles}}
Return JSON only, with exactly these keys:
{
"what_they_sell": "one plain sentence",
"who_they_sell_to": "one plain sentence",
"growth_signal": "one specific fact from the text, or null",
"likely_pain": "one problem our product (cold email infrastructure) solves for them, or null",
"confidence": "high | medium | low"
}
If the text does not support a field, use null. Never invent numbers or names.
What you should see: the same five keys on every row. Rows with confidence: low or growth_signal: null go to a "generic" track or get skipped.
Plan your sending infrastructure with the inbox calculator
- Decide a realistic daily send target for your Stage 3 project (start small: 100–300 a day is plenty to practise the math).
- Enter it into the Inbox & warmup math calculator above with 15 sends per inbox, 2 inboxes per domain, and a 100% reserve. Write down the inbox and domain counts.
- In a sheet, build a 14-day warmup schedule for one inbox: day 1 at 5 emails, adding 1 a day to day 14. Then continue it as a cold ramp from day 15, adding 1 a day up to your per-inbox target.
- Write your bounce-rate rule under the schedule: swap the inbox above 3% bounce; stop, replace and re-check the list above 10% (§3.3).
- Check a real domain's email security records. In Git Bash/Terminal, look up the SPF and DMARC records of any company (try
hubspot.com), or a domain you control:
nslookup -type=txt hubspot.com # look for a line starting with "v=spf1"
nslookup -type=txt _dmarc.hubspot.com # look for a line starting with "v=DMARC1"
- Write what you found: does it have SPF? DMARC? What policy (
p=none,p=quarantineorp=reject)? A company withp=rejecttells inboxes to block fake mail pretending to be them.
What you should see: a written warmup schedule you could hand to someone else to run, plus inbox and domain counts that match what the calculator shows for your target.
Common mistakes
- Letting the LLM read raw web pages and write in one step. Research first into JSON, then write.
- Burning your main domain on cold email.
- Pulling 5,000 rows in Clay before the prompt works. Test on 20, then 100.
- Sending from day one at full volume instead of running the 14-day warmup.
Proof of work
A verified, researched list for a real company
- Pick one real B2B company as your "client". Write its ICP and persona.
- Plan its sending infrastructure: inboxes and domains needed for a daily target, with a reserve.
- Build a small sample of the same 10-row slice of your ICP two different ways from §3.4's three methods (for example, a database pull and a hand-built Clay waterfall, or either one against a Google Maps pull if your ICP fits it) and write down what each found: coverage, how many survived qualification, and roughly how long each took.
- Share a read-only Clay table (or a CSV) of 25 rows carried through company and people discovery, email-finding and verification, and grounded JSON research — stop before the writing column; Stage 4 picks up from here.
- Publish a short write-up: your filters, your infra math, your two-method comparison, and your research prompt with sample output.
Check yourself
Stage checklist
Stage 04 · Create pipeline
Offers, Testing & Reply Operations
Turn the researched list from Stage 3 into a tested, converting campaign: offer design, 1:1 email writing with guardrails, sequencing, contacts-per-lead testing, reply-handling RevOps, and the AI-agent layer that runs the whole motion.
Learning outcomes
By the end of this lecture you should be able to:
- Classify an offer using the four offer categories and the six-part offer framework, and explain why the offer precedes targeting and copy.
- Reconcile the evidence for and against AI-generated message-level personalisation, and state when list-level relevance should be preferred instead.
- Define contacts per lead, read campaign benchmarks against it, and diagnose a reply-rate drop with a symptom–cause table.
- Design a multi-step, automated sequence that stops on reply, bounce or unsubscribe.
- Design a reply-handling system with explicit speed-to-lead SLAs, a reply taxonomy, and a pre-call workflow that raises show rate.
- Explain the skills/tools/guardrails architecture for an AI agent running an outbound motion, and choose the right automation tool for a given task shape.
Prerequisites: Lectures A, B, 2 and 3. Reading time: about 45 minutes, plus 6–7 hours of labs.
Lecture notes
Lecture 4: Offers, Testing and Reply Operations
4.1 Offer design: the lever that decides whether copy works
Among the layers in this chapter, offer design is the one most often skipped by engineers moving from tools straight to automation — and it is the one that decides whether any of the systems above make money. The working order is offer, then targeting, then copy: a strong offer gets replies even with average copy; a weak offer gets nothing even with excellent copy, because copy can only communicate an offer, not manufacture one.
Six parts of a good offer
An offer can be scored against six properties: low risk to say yes to, little effort required to accept, a big upside if it works, something the recipient actually wants rather than something sellable, urgency tied to their role specifically, and fast delivery of the first value. A good offer has at least three of the six; cold outbound specifically needs low risk, little effort and fast value on every send, because a cold recipient has no accumulated trust (§4.2) to spend on a slow or demanding offer.
Three types of front-end offer
A front-end offer is the first thing asked for, ordered here from least to most work for the recipient: a sales asset (a case study, a playbook, a short video) that costs them only attention; a small paid deliverable — a fast, cheap version of the main product or service; and a free trial or pilot (free credits, a free month, a free campaign) that costs more attention and some risk tolerance. The harder the full offer is to say yes to, the further down this list the front-end offer should sit, trading a smaller first ask for a higher chance of getting any ask accepted at all.
What a cold recipient is actually deciding, in about five seconds
A cold email is treated as spam before a single word is read with attention; what survives that first scan answers, implicitly, five questions at once: does this make me money, save me time, or lower my risk; has this worked for someone like me before; do they know anything specific about me; is this a real person; and is this a waste of my time. This is a cold-start trust problem in the sense Lecture 12 discusses under signalling (Spence, 1973): a stranger has no track record to point to, so a message that demonstrates prior results and specific knowledge substitutes for the credibility a warm referral would otherwise supply.
Five building blocks, and a discipline for cutting everything else
The content of a working cold email reduces to five blocks: a specific problem, a result from a comparable company, an offer that is easy to say yes to, a detail about the recipient's company that could only be known by actually looking, and an insight about their market or role. Content outside these five is, almost without exception, filler that lengthens the email without raising any of the five seconds' worth of questions above in the reader's favour.
Operating rules
- Under 65 words; shorter again in crowded markets where the recipient has seen many similar emails.
- Subject lines of one to four words, lowercase.
- A low-friction permission ask ("worth a quick look?") in place of a direct meeting ask, which raises the cost of saying yes before trust has been earned.
- Two emails on one angle, then a new angle on the next touch rather than a repeat of the first (§4.4) — repetition reads as persistence without new information, which is itself evidence against "is this a waste of my time".
Named frameworks
Three short structures account for a large share of working cold emails: the one-liner ("{First name}, interested in {front-end offer} for {company}?"), problem-and-fix ("{A problem verifiable from outside the company}. Our {solution} does {fix}, so you can {result}. Interested?"), and lead-magnet-and-case-study ("Created a {lead magnet} for {company} covering the {mechanism} we used to help {a similar company} get {result} within {time frame}. Mind if I share it?"). Each is a scaffold for the five building blocks above, not a substitute for having a true, specific fact to put in it.
Copy produced this way is still drafted, not written from a blank page: a messaging instruction set (§4.6) that already holds the frameworks, the operating rules, and the segment's researched facts (§3.4, §3.5) can produce a usable first draft directly, which a person then edits against the six-part offer checklist and the five building blocks rather than against vague taste. A first draft that opens with a decent line but a weak offer is corrected by restating the offer, not by rewriting the opening line around the same weak offer.
4.2 Reconciling personalisation: list-level relevance versus message-level personalisation
Personalisation is frequently misunderstood as a single thing, and the manual's own earlier treatment of it needs a careful addition here because two different bodies of evidence about it can look, at first glance, like they disagree. Keeping the original distinction is the starting point. Superficial personalisation inserts the recipient's name, title or company into a template ("I saw you're the VP of Sales at Acme"); it conveys no information the recipient does not already have and is widely recognised as automated. Relevant personalisation connects a specific, verifiable fact about the recipient's situation to a problem the seller solves, and explains why the conversation is timely — observation → implication → offer → low-friction question.
Relevant: "Hi Ada, Acme has posted four SDR roles this month. New SDRs usually spend their first weeks on cold inboxes that land in spam. We set up and warm sending infrastructure so new reps reach the inbox from day one. Worth a look before they start?"
A finding that qualifies, rather than contradicts, this theory
Separately, practitioners running controlled tests of AI-generated per-recipient personalisation lines — an AI column inserting a bespoke sentence into an otherwise templated email, at the scale of thousands of rows — report that adding this kind of personalisation performed worse than a templated email sent to a sufficiently narrow list, and have adopted "no AI personalisation" as a standing rule as a result. This looks, at first reading, like direct evidence against §3.4's "relevant personalisation" theory. It is not, once the two mechanisms are told apart.
The Ada/Acme example above is message-level relevance: one human, writing one email, inserting one fact they personally verified. The practitioner finding concerns a different mechanism at a different scale: an AI column generating a bespoke line per row, unverified, across thousands of rows. Two things change between those cases, not one. First, §3.5's hallucination risk reappears in a new form: a research pipeline with a measured roughly 15% false-fact rate before the fixes in that section's case study will, at scale, insert a noticeable share of wrong or merely generic-sounding "personalised" facts, and a recipient who spots one invented detail distrusts the whole email more than a frank template would have. Second, list-level relevance — narrowing the list (§3.4) to one segment, one title group, one size band, until the shared offer is true of literally everyone on it — does a meaningful share of the work a bespoke sentence is otherwise asked to do, and it does it once per list rather than once per row, which makes it both cheaper and easier to verify.
The reconciled rule is a preference ordering, not a rejection of either mechanism: prefer list-level relevance as the default, because it is verified once and scales for free; reserve hand-verified message-level personalisation for small, high-value segments where a person can actually check each inserted fact (large enterprise accounts, a target list under a few hundred rows); and treat unverified AI-generated message-level personalisation at volume as the one combination the evidence argues against specifically, not personalisation as a concept. This is the manual's ordinary practice for conflicting evidence (Lecture 11's triangulation, Lecture 8's case study on correlation and causation): state both findings, locate the boundary condition that explains the apparent conflict, and keep the narrower, truer rule rather than discarding either side.
Writing quality, under either mechanism, should still be evaluated against explicit criteria (specificity, truthfulness, timeliness, brevity, ease of reply) on a labelled sample before scaling, and prompt changes made one at a time and re-evaluated on the same sample — the controlled-experiment discipline established here and reused again in §4.3 for offer testing.
4.3 Testing and scaling: contacts per lead
Once a list, an offer and a sequence exist, the question becomes what to test and how to read the result. The variable worth testing is the offer itself, not surface wording: swapping "Mind if I" for "Cool if I" changes nothing measurable, because it changes none of the five building blocks (§4.1) a recipient is actually weighing.
Defining the metric
Contacts per lead (CPL) is a single-number summary of how efficiently a given offer, on a given list, produces a positive reply. Commonly used bands: under 500 is a good range for a fresh offer; around 1,000 is where offers catching existing, already-present demand (rather than creating interest from nothing) often sit; 2,000 to 3,000 or more signals that the offer or the segment, not the copy, needs to change.
| Campaign | Contacts per lead | Context |
|---|---|---|
| Custom foodservice packaging manufacturer | 60 | 1,100 positive replies in 21 days |
| Agency selling to seven-figure ecommerce brands | 266 | One of the most crowded segments in B2B outbound |
| Enterprise-focused B2B team | 867 | Enterprise deals need more contacts per lead by nature of the buying group |
| Financial-services tax product (Glidepath/CRAFT) | 740 | 22,939 contacted → 31 leads → $4M pipeline |
Volume, refresh and the size floor
A market should be refreshed on a cycle, commonly every 30 to 60 days, because a contact who declined in one month can be ready two months later as their own priorities change — the same timing-signal logic from Lecture 2 applied to the seller's own list rather than to a single account. Below a certain market size — commonly put around 10,000 companies — the fixed cost of building and maintaining automated outbound infrastructure stops paying for itself relative to working the small, known list by hand; account-based marketing, with its much higher per-account effort, becomes the better-fitting motion once the addressable market is that small.
Diagnosing a drop
| Symptom | Likely cause | What to check first |
|---|---|---|
| Reply rate halved, nothing else changed | Deliverability | Run a placement test (§3.3) before touching copy |
| Landing in Google, not in Outlook | Provider-specific filtering | Split and review Outlook-bound copy and list separately (§3.3) |
| Landing everywhere, zero replies | Stale copy or a dead offer | Re-test the offer itself (§4.1), not a copy variant |
| Reply rate under 0.5% after several copy changes | Deliverability, not copy | Inbox and bounce-rate audit (§3.3) |
The ordering in this table is not arbitrary: it checks the layer most likely to silently fail (infrastructure) before the layer most visible to the person running the campaign (copy), which is the opposite of where attention naturally goes first.
4.4 Sequences and orchestration
A sequence (or cadence) is a scheduled series of touches across channels. Multi-touch sequences reflect the observation that few replies arrive after the first message, while too many touches create annoyance and spam complaints. Effective sequences vary the angle of each message rather than repeating the first (§4.1), mix channels (email, LinkedIn, occasionally phone), and end with an explicit close. Sequencers (Outreach, Salesloft, Apollo, Smartlead, Instantly, EmailBison) manage timing, throttling, reply detection and tracking; high-volume cold programmes commonly run with open-tracking off and plain text rather than HTML or links, because tracking pixels and links are themselves deliverability risk factors that providers weigh against sender reputation (§3.3).
Human-in-the-loop design
Fully autonomous "AI SDR" systems that send without review have attracted criticism for producing generic or inaccurate messages at volume. A more robust design places human review at defined control points: approving prompt changes, sampling outputs for quality, and handling every reply (§4.5). Automation is reserved for the deterministic and the repetitive; judgement remains with people.
4.5 Reply handling and revenue operations
A positive reply is worth nothing until it becomes a meeting that actually shows up; more value is reported lost at this stage than anywhere earlier in the chain, because a slow or clumsy response undoes the work every earlier layer did to earn the reply in the first place.
Speed to lead
Lecture 2.4 already established, citing Oldroyd, McFarland and Whittemore (2011), that contacting a lead within roughly five minutes dramatically outperforms slower response. The same effect reappears here as an operating SLA: reply within one minute where possible, because speed matters more than the polish of the wording; inside five minutes, roughly 20–30% of positive replies are reported to convert to a booked meeting; after an hour, that figure falls to around 5% or less. This is Lecture 2's finding given a concrete tier structure to operate against rather than a single average.
Calling, not just messaging
When a positive reply is called rather than only emailed, and the recipient picks up, a reported 80–90% book a meeting on that roughly 60-second call. A live call removes the asynchronous back-and-forth of proposing times by message, which is itself a small reduction in the effort the recipient must spend to say yes (§4.1's "little effort" offer property, applied to the booking step rather than the first email).
Booking rules
Offer two specific times rather than sending a scheduling link with no proposed time, which asks the recipient to do the scheduling work instead of choosing between two options; book within two days, with same-day best, because intent decays with delay; and hold the exact price for the live conversation rather than quoting it over email, where exact prices are reported to rarely convert — a pattern consistent with the anchoring and framing effects covered in Lecture 12 (Kahneman and Tversky, 1974): a number stated without the context a conversation can supply anchors the recipient's judgement before they understand what they are being quoted for.
The pre-call workflow and show rate
A cold-booked meeting with no reminder system is reported to show up only 20–30% of the time. Adding a short confirmation video, a same-day LinkedIn connection request, and reminders at 24 hours, 4 hours and 1 hour before the call raises that to a reported 60–80%. Each element adds a small, low-effort point of contact that keeps the commitment salient — consistent with the commitment-and-consistency mechanism Cialdini (1984, cited in Lecture 12) describes: once a person has taken a small confirming action, they become more likely to follow through on the larger commitment it is attached to.
A taxonomy for routing replies
Replies sort cleanly into a small number of types: interested, wants more information, asking the price, wrong person, later, and out of office, plus not interested, which should move the contact to a permanent do-not-contact list rather than simply end the sequence — the suppression obligation already established under CAN-SPAM and GDPR in Lecture B applies in full here, independent of any marketing judgement about whether to try again later.
The reply-routing system
A representative architecture: a reply lands in the sequencer, a webhook forwards it to an automation platform, an AI step tags the reply's intent, positive replies trigger a phone-number lookup and a CRM record, and the whole thread posts to a messaging channel with action buttons for the rep to call, send an AI-drafted reply, edit it, or skip it. This is §3.5's separation of concerns applied to a different stage of the same motion: one agent decides positive-or-negative, because an agent given exactly one decision to make performs that one decision more reliably than an agent asked to decide, classify and score all at once; a second agent then classifies the reply type above; a third scores how well the lead fits. §4.6 generalises this "one job per agent" pattern as a design principle for the whole automation layer, not just for replies.
4.6 The AI agent layer: skills, tool connections and guardrails
This layer is frequently where engineers want to start, and it is the layer that works least well started first: an agent automates what a person has already written down, so it can only be as good as the strategy (§3.2), the qualification logic (§3.4), the offer (§4.1) and the reply taxonomy (§4.5) it is given to run. Treated as the capstone rather than the entry point, it is a genuine force multiplier on everything above it.
Skills: written instructions for one job
A skill, in this sense, is a written, ordered set of instructions an AI agent follows to complete one job: the steps in order, the tools to call at each step, and what a good result looks like, so the same job runs the same way whoever or whatever is running it. An enrichment skill, for example, might specify a waterfall exactly as in §3.4 — try one email-finder first, fall back to a second for anyone missed, fall back to a third, then verify twice — written down once and reused on every list rather than rebuilt by hand each time. The skill is, in effect, the inspectable intermediate artefact from §3.5 moved up a level: instead of inspecting one row's research output, the system under inspection is the recipe itself.
Connecting the tools
An agent reaches the tools it needs to run a skill through their APIs, through MCP servers (a standardised protocol for exposing a tool's actions to an agent), or through a tool's own command-line interface — the same three integration surfaces Lecture B.2 already taught for a single API call, now composed across several tools in one pipeline. A practical pattern connects a data-enrichment platform through its command-line tool and a sequencer through its API, so a campaign can be qualified, built and launched from a single instruction without manually moving data between separate dashboards.
Guardrails
Three guardrails recur across reliable agent deployments, and all three are specific instances of the human-in-the-loop principle already established in §4.4: the agent runs a small test first and shows the result before running the full job; it asks before spending paid credits, since enrichment and verification calls cost money per row; and it stops and asks when a request is ambiguous rather than guessing and proceeding. These are the same control points §4.4 places around sending, now placed around the agent's own actions.
Context quality
An agent's output quality is governed almost entirely by the context it is given, which is Lecture 8's RAG and grounding argument (P. Lewis et al., 2020) restated for an operational pipeline rather than a knowledge-base question: a copy-writing skill that reads thousands of past scripts alongside their measured results, or a strategy skill that reads a client's own onboarding answers, past sales-call transcripts and the details of deals that actually closed, has far less to guess at than one given only a company name. Sales-call recordings are reported to be an unusually high-quality context source for exactly the reason Lecture 8.2 gives: they are the buyer's own words, not a seller's summary of them.
Choosing the right tool for the task shape
| Task shape | Tool category that fits it | Why |
|---|---|---|
| Strategy, messaging, anything iterated on by hand | An interactive coding/reasoning agent | Iteration needs a human reading each version; raw throughput is not the bottleneck |
| Large-batch enrichment | A cheaper, higher-throughput agent runtime | Per-row cost dominates at volume; little benefit from the most capable model on a yes/no question |
| High-volume deterministic routing (reply scoring at thousands/day) | A workflow-automation platform (n8n-style) | Fixed logic at high throughput is what these platforms are built for |
| Testing a new workflow on a small list before scaling | A visual, row-by-row workspace (Clay-style) | Cheap to inspect failures one row at a time before the logic is trusted at volume |
The table maps task shape to tool category deliberately rather than to specific products, because the category survives longer than any one vendor's current pricing or performance; the underlying judgement — match the tool's strengths to how a task actually fails — does not change even when the names in the right-hand column do.
One shared agent, and its real maintenance cost
A team can run one shared agent, always on, connected to the whole stack and reachable by anyone on the team from a messaging channel. This is a genuine capability upgrade and a genuine ongoing cost: agents go down, skills need updating as the business learns, and the APIs behind them change on their own schedule. For a business whose entire output is running this motion for clients, that maintenance is worth absorbing. For a company where outbound is one function among several, the honest question is whether the maintenance burden is worth taking in-house versus buying it as a service — the same build-versus-buy trade-off Lecture 9 applies to ecosystem integrations, reapplied here to the agent layer itself.
Automating the recurring audit
One recurring job is worth automating specifically because it is both repeatable and easy to specify correctly: on a fixed schedule, pull each inbox's reply and bounce rate from the sequencer, flag anything at or below roughly a 0.5% reply rate or at or above a 3–5% bounce rate (§3.3's thresholds), and replace those inboxes. What was previously a recurring manual spreadsheet exercise becomes a scheduled job precisely because the rule triggering it is already fully written down — which is the condition §4.6 opened with: automation works once the judgement behind it has already been made explicit.
Lecture summary
- Offer design precedes targeting and copy: six offer properties, three front-end offer types, five building blocks of a working email, and operating rules on length, subject lines and cadence.
- The "no AI personalisation" finding qualifies rather than contradicts relevant-personalisation theory: list-level relevance should be the default, hand-verified message-level personalisation reserved for small high-value segments.
- Contacts per lead is the metric for testing an offer at scale; it is a diagnostic to read alongside lead value, not a universal pass/fail bar, and reply-rate drops should be diagnosed infrastructure-first.
- A sequence is a planned, multi-touch series across channels that stops automatically on reply, bounce or unsubscribe.
- Reply handling has measurable SLAs — speed to lead, calling conversion, booking rules, and a pre-call workflow that raises show rate — and replies sort into a fixed taxonomy with a mandatory suppression path.
- The AI agent layer (skills, tool connections, guardrails, context quality) is a force multiplier placed last, because it runs on judgement made explicit in the stages before it.
Review and discussion questions
- Score a cold email you have received (or write one) against the six offer properties and the five building blocks. What is missing?
- A practitioner reports that AI-generated personalisation underperformed a templated email. Explain why this does not contradict the manual's earlier "relevant personalisation" theory, using the list-level/message-level distinction.
- A campaign shows reply rate under 0.5% after three rounds of copy changes. Using the diagnostic table, what should be checked next, and why in that order?
- Explain the three reported speed-to-lead tiers and connect them to Lecture 2.4's citation.
- Why does the manual recommend building an agent's skills and guardrails last, rather than first?
- Design a one-job-per-agent pipeline for reply routing with at least three separate agents, and state what each one alone decides.
Further reading
- Aaron Ross and Marylou Tyler, Predictable Revenue (2011).
- Clay University course material on waterfall enrichment and Claygent.
- Christian, GTM University (gtmu.io): the Level 1–7 outbound-engineering framework, contacts-per-lead benchmarks, reply-handling SLAs and the AI-agent/skills architecture drawn on throughout this chapter are practitioner material from this source, cited here as applied industry practice alongside the academic citations above, not as peer-reviewed research.
In one sentence
Design a real offer, let an LLM draft the first email while a human checks it, test the offer by contacts per lead, run it as a stoppable sequence, and route every reply to a person inside minutes.
The big idea
An SDR (sales development rep) spends most of the day writing, sending and chasing replies. A GTM engineer automates the first draft and the routing, so one person can run the work of five — without sending a weak offer at scale or losing a reply to a slow inbox.
The phrase "AI SDR" is often sold as "fire your reps." That is not the goal here. The goal is relevance at scale on a list already narrowed enough to earn it: every email has a clear reason for being sent now, every offer is tested against a real number, and every reply reaches a person fast enough to still matter.
Words you must know
- Front-end offer
- The first, smaller thing you ask a cold prospect to say yes to — a case study, a paid pilot, a free trial.
- Sequence
- A planned series of emails or touches over days, stopped automatically when someone replies.
- Contacts per lead
- People contacted ÷ positive replies. The main number for judging whether an offer is working.
- Speed to lead
- How fast a rep responds to a positive reply. Minutes, not hours, is the difference between a meeting and silence.
- Skill (for an AI agent)
- A written, step-by-step instruction set an agent follows to do one job the same way every time.
How it works, step by step
Try it · Contacts per lead
Is this offer working?
Practical labs
Build the full research-to-email table in Clay
- Write your ICP in one line (use Lab A.2). Example: "US B2B SaaS companies, 50–500 staff, hiring SDRs, using HubSpot." Persona: "VP Sales or Head of Growth."
- Find companies. In Clay, click + New → Find companies. Set filters for industry, size and country. Set the limit to 50 rows while you practise (credits are money). Click Import to save the table.
- Find people. Click Add column (or Actions) → Find people at company. Filter job titles: "VP Sales", "Head of Sales", "Head of Growth". Limit 1–2 per company. Clay creates a linked People table.
- Find emails with a waterfall. In the People table, add the Work email waterfall enrichment, then an email validation column after it. Filter the table to show only rows marked valid.
- Add a research column. Add an AI / Claygent column. Paste the research prompt from Stage 3 Lab 3.3 and choose JSON output.
- Add a qualify column. Add an AI column that answers "Is this a fit? yes/no and why", using the research column. Filter out the no's.
- Add a writing column. Add an AI column with the email prompt from Lab 4.2. Reference the research column, not the raw website text.
- Run on 5 rows first. Turn off auto-run, select 5 rows, and click Run. Read the results.
- QA. Then run 20 rows. Read all 20 emails. Fix the prompt, not the emails, until 18 of 20 could be sent unchanged.
- Push. Send approved rows to your sequencer (Smartlead, Instantly, Apollo or Outreach) with its Clay integration, or export a CSV.
What you should see: a table where every row has a person, a verified email, 3 researched facts, a fit decision and a short email that could only have been written for that person.
Write 1:1 cold emails with guardrails
- Copy the prompt below. Replace the
{{ }}parts with a real row: your name, the prospect's first name, title and company, two facts from your Stage 3 Lab 3.3 JSON, and a "why now" trigger. - Paste it into Claude.ai and send. Copy the email into a Google Sheet, one email per row.
- Repeat for 10 different prospects (in Clay, add it as an AI column and run 10 rows).
- Add five columns to the sheet, one per check in the table below. Mark each email 1 (pass) or 0 (fail).
- Find the check that fails most. Change one rule in the prompt to fix it. Rerun the same 10 rows and compare scores.
Write a cold email from {{sender_name}} to {{first_name}}, {{title}} at {{company}}.
Facts you may use (use 1 or 2, never invent others):
- Growth signal: {{research.growth_signal}}
- Likely pain: {{research.likely_pain}}
- Why now: {{trigger}} e.g. "hiring 4 SDRs this month"
Our offer: we set up and warm cold email inboxes so new SDRs hit the inbox from day one.
Rules:
- 60 to 90 words. Plain text. No links. No images.
- First line is about THEM and mentions the specific fact. No "I hope this finds you well".
- One clear problem, one sentence on how we help, one soft question as the call to action.
- No exaggerated claims, no fake familiarity, no exclamation marks.
- Write at a 6th-grade reading level.
Return only the email body.
| Check | Pass if… |
|---|---|
| Specific | It could not be sent to a different company unchanged. |
| True | Every fact is in the research. Nothing invented. |
| Timely | It gives a reason to talk now. |
| Short | Under 90 words, readable on a phone. |
| Easy to answer | The question can be answered with "yes", "no" or one line. |
What you should see: a score out of 50 for your 10 emails, and a higher score after your prompt fix. Aim for 45+ before you scale.
Design and score three offers
- Pick one real target company (use the one from Lab 4.1, or your own ICP).
- Write three different front-end offers for it: one sales asset, one small paid deliverable, one free trial or pilot (§4.1).
- Score each offer 0 or 1 on each of the six offer properties (low risk, little effort, big upside, something they want, urgent for their role, fast to deliver value). Add the six scores.
- Write one cold email per offer using one of the three named frameworks (§4.1), keeping everything else — the persona, the researched fact, the trigger — identical across the three.
- Show all three to someone who works in or sells to that industry. Ask which one they would reply to, and why.
What you should see: the offer that scores highest on the six-part checklist is usually, though not always, the one people say they would reply to — and when it isn't, the reason given almost always maps to one of the five building blocks (§4.1), which tells you exactly what to fix.
Design an automated sequence and set your sending-safety rules
- In a Google Sheet, copy this sequence plan as a table and write the actual message for each step, using your best email from Lab 4.2 as Email 1.
| Day | Step | Content |
|---|---|---|
| 1 | Email 1 | The personalised email from Lab 4.2 |
| 3 | View profile, then a connection request with no pitch | |
| 5 | Email 2 (same thread) | One useful resource or a short example from a similar company |
| 9 | Email 3 | A different angle: a second pain point |
| 14 | Email 4 | Polite close: "Should I stop reaching out?" |
- Under the sequence, write your sending-safety rules, using the inbox and domain counts you already worked out in Stage 3 Lab 3.4: buy a separate sending domain (for example
tryacme.com, never the main one), keep each inbox on its warmup schedule before the cold ramp, keep volume low per inbox (a common rule is 15, at most 20, cold emails a day), and stop the sequence on any reply, bounce or unsubscribe. - Add one row per step for a bounce/reply rule: which inboxes pause automatically, and who re-checks the list above a 3% bounce rate (§3.3).
What you should see: a 5-step sequence with real copy, plus a written set of sending-safety rules that plug directly into the inbox and domain counts from Stage 3 Lab 3.4 — no separate deliverability check needed here.
Track contacts per lead and diagnose a drop
- In a sheet, create one row per offer you have tested (real numbers if you have run a campaign; otherwise use plausible estimates and label them as such).
- For each row, record people contacted and positive replies, then enter both into the Contacts per lead calculator above and record the result and its band (§4.3).
- Rank your offers by contacts per lead. A stricter rule some teams run in practice flags anything above 1,000 for review before scaling it further; treat 2,000 and above (§4.3's "needs to change" band) as a hard stop — a rewrite, not a resend.
- Pick one symptom from §4.3's diagnostic table (for example, "reply rate halved, nothing else changed") and write out, in order, exactly what you would check first, second and third, and why that order.
What you should see: a ranked table of offers by contacts per lead, and a written diagnostic order that checks infrastructure before copy.
Common mistakes
- Fake personalization: "I saw you're the VP of Sales at Acme!" That is just the mail-merge fields read back.
- Sending without reading a sample. Always QA 20 rows before you scale.
- Treating AI-generated personalization as mandatory instead of testing it against a tighter, better-qualified list.
- Quoting an exact price over email instead of holding it for the live call.
- Letting a positive reply sit unanswered for hours instead of routing it to a person in minutes.
Proof of work
A tested, converting 1:1 outbound campaign
- Using the list from Stage 3, write and QA 1:1 emails for your chosen offer (18 of 20 passing the 5-point check).
- Score the offer against the six-part framework and run the campaign for long enough to compute contacts per lead.
- Design the sequence and the reply-routing SLA you would run it under.
- Publish a short write-up: your prompts, your QA scores before and after, the six-part score for the offer you chose, your contacts-per-lead number, and what you changed.
Check yourself
Stage checklist
Stage 05 · Product & money
PLG Telemetry & PQL Scoring
When people try your product for free, their actions tell you who is ready to buy. Learn to record those actions and turn them into a score that alerts sales.
Learning outcomes
By the end of this lecture you should be able to:
- Define product-led growth and explain the conditions under which it works.
- Describe the activation framework (AARRR), and define activation, the aha moment and time to value.
- Design a tracking plan using a consistent event taxonomy and the identify/group/track model.
- Explain the role of a customer data platform and how event data reaches the warehouse.
- Identify an activation threshold from retention data, and explain the difference between correlation and causation in this analysis.
- Construct, calibrate and evaluate a product-qualified lead score using precision, recall and lift.
Prerequisites: Lectures 1 and 2. Reading time: about 60 minutes, plus 10 hours of labs.
Lecture notes
Lecture 5: PLG Telemetry and PQL Scoring
5.1 Product-led growth
Product-led growth (PLG) is a GTM model in which the product itself is the primary means of acquiring, activating, converting and expanding customers. Users sign up through a free plan or trial, experience value without sales assistance, and pay when they reach a limit or need more capability. The term was popularised by the venture firm OpenView from around 2016, and the model is associated with companies such as Slack, Dropbox, Atlassian, Zoom, Calendly and Notion.
PLG works under specific conditions: the product must deliver value quickly without configuration or training; the user who adopts it must be able to start without procurement approval; and the price of entry must be low enough for self-service. Its main advantage is a low cost of acquisition per user. Its main challenge is that only a small share of free users ever pay, and the users with the greatest potential value are often hidden among many who will never buy. Product-led sales addresses this by using product data to identify which accounts merit human sales engagement.
5.2 Activation, the aha moment and time to value
Dave McClure's AARRR framework (2007), the "pirate metrics", divides the user lifecycle into Acquisition, Activation, Retention, Referral and Revenue. In PLG, activation is usually the most important stage, because users who do not experience value early rarely return.
Activation is the point at which a new user first experiences the product's core value. The aha moment is a behavioural definition of activation: a specific action, performed a specific number of times within a specific period, that is strongly associated with long-term retention. Widely cited examples include Facebook's early finding that users who added seven friends within ten days were far more likely to remain active, and Slack's observation that teams which had exchanged around 2,000 messages were very likely to keep using the product. Time to value (TTV) is the elapsed time between sign-up and activation; reducing it is a principal objective of onboarding design.
5.3 Product telemetry and tracking plans
Telemetry is the automated collection of data about how a product is used. In analytics, behaviour is captured as events: discrete, timestamped records of an action, each with a name and properties. The quality of every downstream analysis, including PQL scoring, depends on the quality of event design.
The tracking plan
A tracking plan is the specification of every event: its name, when it fires, its properties and their types, and the business question it serves. It functions as a contract between product, engineering and analytics. A consistent naming convention, commonly Object Action in past tense and title case ("Report Created", "Teammate Invited"), prevents the proliferation of synonymous events that makes analysis unreliable. Good plans are deliberately small: tracking every click produces volume without insight, while a focused set of 10–20 meaningful events supports most decisions.
Identity and account context
The specification popularised by Segment defines several call types. Identify associates a user identifier with traits (email, role). Track records an event. Group associates a user with an organisation (account or workspace) and its traits. Page and screen record views. In B2B, the group call is essential, because buying decisions are made by organisations: a PQL is almost always an account, not an individual user. Anonymous activity before sign-up is linked to the identified user through an anonymous identifier and, where supported, an alias operation.
5.4 Customer data platforms and the event pipeline
A customer data platform (CDP) such as Segment (acquired by Twilio in 2020) or RudderStack collects events from web, mobile and server sources through software development kits, validates them against the tracking plan, and forwards them to destinations: analytics tools, marketing platforms and, most importantly for GTM engineering, the data warehouse. Server-side tracking is generally preferred for business-critical events (sign-up, payment, plan change) because client-side tracking is affected by ad blockers and browser restrictions. Once events land in the warehouse, they can be joined with CRM and billing data (Lecture 1), which is what makes account-level scoring possible.
5.5 Finding the activation threshold
The analytical method for identifying an aha moment is to compare retention across groups defined by early behaviour. For a candidate action, users are bucketed by how many times they performed it in their first week, and the share of each bucket still active several weeks later is calculated. The candidate threshold is where retention rises most steeply and then plateaus: below it, additional actions are associated with large gains; above it, with little further gain.
This analysis establishes correlation, not causation. Users who perform an action many times may already be more motivated, better suited to the product or part of larger teams; the action may be a symptom of their success rather than its cause. This is known as selection bias or confounding. The threshold should therefore be treated as a hypothesis and tested experimentally, for example by randomly assigning half of new users to an onboarding flow that encourages the action and comparing their retention with a control group. Only a difference in that randomised comparison justifies the conclusion that encouraging the action improves retention.
- countif(e.event_name = 'Report Created' and e.event_at < timestamp_add(u.signup_at, interval 7 day)) as reports_wk1
- A conditional count bounded by a time window computed relative to each user's own signup time, not a fixed calendar date —
timestamp_add(u.signup_at, interval 7 day)means "7 days after this specific user signed up," which is essential: without this, users who signed up at different times would be compared across different, misaligned windows, making the bucketing in §5.5 meaningless. - count(e.event_name) > 0 as active_week_4
- A boolean derived column: did this user generate any event at all inside the week-4 window (computed in the join condition below)? This is the "still active" measurement that each bucket's retention percentage in the worked example is built from.
- on e.event_at between timestamp_add(u.signup_at, interval 21 day) and timestamp_add(u.signup_at, interval 28 day)
- Defines "week 4" as the 7-day window from day 21 to day 28 after signup — again relative to each user, following the same per-user windowing principle as the first CTE. This is placed in the join's
onclause rather than a separatewherefilter specifically so that users with zero events in this window still produce a row (with NULL), whichleft jointhen preserves rather than dropping them from the result. - least(reports_wk1, 10) as reports_in_first_week
- Caps the bucketing dimension at 10: without this, a handful of unusually heavy users (50+ reports in one week) would each form their own near-empty bucket, fragmenting the chart's tail into noise instead of one clean "10 or more" bucket at the end, which is exactly what the comment flags.
- round(avg(if(active_week_4, 1, 0)) * 100, 1) as pct_still_active_wk4
- Converts the boolean
active_week_4column into 1s and 0s and averages them — the average of a 0/1 column is exactly the proportion of 1s, which is a standard SQL idiom for computing a percentage without a separatecount(*) / count(*)ratio calculation.
5.6 Product-qualified leads
A product-qualified lead (PQL) is an account whose product usage, combined with its fit, indicates readiness for a sales conversation. PQLs contrast with marketing-qualified leads (MQLs), which are based on engagement with marketing content. Because PQLs are based on demonstrated value rather than stated interest, they typically convert at much higher rates, although exact figures vary considerably by company.
Constructing a score
A practical PQL score combines three components, each capped so that no single component dominates:
- Fit: similarity to the ICP (size, industry, region).
- Usage: breadth (number of active users), depth (key actions) and recency or frequency (active days).
- Buying intent: pricing page visits, plan-limit encounters, requests about security or administration features.
Initial weights are set by judgement, but they must be calibrated against outcomes. The simplest method is to score last quarter's accounts as they were at the time and compare their scores with whether they later converted. A more rigorous method fits a statistical model, such as logistic regression, to historical outcomes so that weights reflect observed relationships (Lecture 9 uses the same technique for churn).
Evaluating a score
A score is a classifier, and it should be evaluated with classification metrics. Precision is the share of accounts flagged as PQLs that actually convert; low precision wastes sales time. Recall is the share of all converting accounts that were flagged; low recall means sales misses good opportunities. Raising the threshold usually increases precision and decreases recall, so the threshold is a business decision about sales capacity. Lift expresses how much more likely a flagged account is to convert than an average account. A PQL definition with a lift close to 1 adds no value.
Lecture summary
- PLG uses the product as the primary acquisition and conversion channel; it requires fast, unassisted time to value.
- The aha moment is a behavioural definition of activation: an action, a frequency and a time window associated with retention.
- Tracking plans with consistent Object Action naming, and identify/group/track calls, make product data analysable at account level.
- CDPs route events to the warehouse, where they can be joined with CRM and billing data.
- Threshold analysis finds correlation; randomised experiments are needed to establish that encouraging an action causes retention.
- PQL scores combine fit, usage and intent; they must be calibrated against outcomes and evaluated with precision, recall and lift.
Review and discussion questions
- Under what product conditions is PLG unlikely to succeed? Give an example.
- Define an aha moment for a product you use, specifying action, frequency and window.
- Why is the group call more important than the identify call for B2B PQL scoring?
- Explain why a correlation between early report creation and retention does not prove causation, and design an experiment to test it.
- A PQL score has 40% precision and 30% recall. What happens to each if the threshold is raised, and how should sales capacity influence the choice?
- Discuss the advantages of PQLs over MQLs and the situations in which MQLs remain useful.
Further reading
- Wes Bush, Product-Led Growth: How to Build a Product That Sells Itself (2019).
- Dave McClure, "Startup Metrics for Pirates: AARRR!" (presentation, 2007).
- Segment documentation, "Spec: Identify, Track, Group" and "Naming conventions".
- Ron Kohavi, Diane Tang and Ya Xu, Trustworthy Online Controlled Experiments (2020).
- Alistair Croll and Benjamin Yoskovitz, Lean Analytics (2013).
In one sentence
Send an event every time a user does something important in the product, find the action that predicts paying, and alert sales when an account crosses that line.
The big idea
PLG (product-led growth) means people sign up and use the product before they ever talk to sales. Slack, Notion, Figma and Calendly grew this way. The problem: thousands of free users, and sales cannot call all of them.
A PQL (product qualified lead) is a free user or account whose behaviour shows they are getting real value and are likely to pay. It is much stronger than an MQL (someone who downloaded an ebook), because it is based on what they did, not what they read.
Words you must know
- Telemetry
- Automatic data about what users do in the product.
- Event
- One action with a name and details, like
Report Createdwithreport_type: pipeline. - Track / Identify / Group
- The three main calls: record an action, say who the user is, say which account they belong to.
- Tracking plan
- A document listing every event, when it fires and its properties. Your contract with engineers.
- Activation
- The moment a new user first gets real value.
- Aha moment
- The specific action (and how many times) that best predicts a user will stay or pay.
- Feature adoption
- The share of active accounts that use a given feature.
- PQL
- Product Qualified Lead: an account whose usage and fit say "ready for a sales conversation".
How it works, step by step
The PQL math
A PQL score adds up three kinds of evidence. Each part has a maximum, so no single part can dominate.
- Fit: is this a company we want? Size, industry, region.
- Usage: how many people use it, how often, and did they hit the Aha moment?
- Intent: did they visit pricing, hit a plan limit, or ask about security?
Pick a threshold (for example 70). Above it, alert sales. Between 50 and 69, send helpful in-app tips instead. Then check every month: of last month's PQLs, how many became customers? Adjust weights until the score predicts well.
Try it · PQL score calculator
Score one free account
Practical labs
Write a tracking plan
- Pick a product you can sign up for free (Notion, Calendly, Loom, or the company from Lab A.1). Sign up and use it for 15 minutes, noting every important thing you do.
- Open a new Google Sheet named Tracking plan – [product]. Add four column headers: Event, Fires when, Key properties, Why we care.
- Write 8–12 events. Name each one Object + past-tense verb in Title Case:
Account Created,Teammate Invited,Report Created. Use this example as a guide:
| Event | Fires when | Key properties | Why we care |
|---|---|---|---|
| Account Created | Sign-up completes | plan, signup_source | Start of the funnel |
| Teammate Invited | Invite email sent | invitee_role | Spreading inside the company |
| Integration Connected | OAuth succeeds | integration_name | Strong stickiness signal |
| Report Created | User saves a report | report_type | Candidate Aha action |
| Plan Limit Reached | User hits a free limit | limit_type | Buying intent |
| Pricing Page Viewed | In-app pricing opened | from_page | Buying intent |
- Mark one event as your candidate Aha action (bold it). This is the action you think predicts paying.
- Check your plan: every event has a "why we care", no two events mean the same thing, and every name follows the same pattern.
What you should see: a short, consistent plan an engineer could implement without asking you questions.
Send events with Segment or RudderStack
- Sign up at
segment.com(free plan). Go to Connections → Sources → Add Source, choose Javascript (Website), name it "Test site" and click Add Source. - Segment shows an install snippet (a
<script>block). Click to copy it. - In the terminal, make a folder for a fake website:
cd ~/gtm-labs, thenmkdir segment-test,cd segment-test,code . - In VS Code, create
index.html, paste the code below, and replace the comment line with your Segment snippet. Save.
<!doctype html>
<html>
<head>
<title>Segment test</title>
<!-- PASTE YOUR SEGMENT SNIPPET HERE (it starts with <script> and ends with </script>) -->
</head>
<body>
<h1>Fake product</h1>
<button onclick="signIn()">1. Sign in as Ada</button>
<button onclick="analytics.track('Report Created', {report_type: 'pipeline', account_id: 'acct_9'})">2. Create report</button>
<button onclick="analytics.track('Pricing Page Viewed', {from_page: 'dashboard', account_id: 'acct_9'})">3. View pricing</button>
<script>
function signIn() {
// Who is this person?
analytics.identify('user_42', { email: 'ada@acme.com', name: 'Ada Obi', role: 'Head of Sales' });
// Which account do they belong to?
analytics.group('acct_9', { name: 'Acme Inc', domain: 'acme.com', employees: 120, plan: 'free' });
}
</script>
</body>
</html>
- Start a tiny local web server in that folder:
npx serve .(typeyif asked). Openhttp://localhost:3000in your browser. - In Segment, open your source and click the Debugger tab. Then click your three buttons in order.
- Optional: add BigQuery as a Segment destination so events land in your warehouse. RudderStack works the same way; its calls are
rudderanalytics.identify,.groupand.track.
What you should see: in the Debugger, a Page call when the page loads, then Identify, Group and two Track calls with your properties, within a few seconds. Press Ctrl + C in the terminal to stop the server when done.
Find the Aha moment with SQL
The question: "How many times must a user do X in their first week before they usually stick around?" Famous public examples include Facebook's "7 friends in 10 days" and Slack's "2,000 messages sent by a team". You find yours with data.
- Open a new query tab in BigQuery. Paste the query below and click Run. It counts each user's "Report Created" events in their first 7 days, then checks if they were still active in week 4.
with first_week as (
select u.user_id,
countif(e.event_name = 'Report Created'
and e.event_at < timestamp_add(u.signup_at, interval 7 day)) as reports_wk1
from gtm_lab.users u
left join gtm_lab.events e on e.user_id = u.user_id
group by u.user_id
),
retained as (
select u.user_id,
count(e.event_name) > 0 as active_week_4
from gtm_lab.users u
left join gtm_lab.events e
on e.user_id = u.user_id
and e.event_at between timestamp_add(u.signup_at, interval 21 day)
and timestamp_add(u.signup_at, interval 28 day)
group by u.user_id
)
select least(reports_wk1, 10) as reports_in_first_week, -- 10 means "10 or more"
count(*) as users,
round(avg(if(active_week_4, 1, 0)) * 100, 1) as pct_still_active_wk4
from first_week join retained using (user_id)
group by 1
order by 1;
- Under the results, click Chart (or Explore data → Looker Studio) to see it as a line. Put reports_in_first_week on the bottom and pct_still_active_wk4 up the side.
- Find the biggest jump between two neighbouring rows. That number of reports is your Aha threshold.
- Now swap
'Report Created'for'Teammate Invited'and run again. Which action predicts retention better?
What you should see: almost nobody with 0–2 reports in week 1 is still active in week 4, then a big jump at about 3 reports (from under 10% to over 60%), then it flattens near 100%. Write it as a rule: "Users who create 3+ reports in their first week usually stick around."
Draw a feature adoption curve
- Open a new query tab, paste this and click Run. It shows, for each week, the share of active accounts that connected an integration:
select date_trunc(date(event_at), week) as week,
round(count(distinct if(event_name = 'Integration Connected', account_id, null))
/ count(distinct account_id) * 100, 1) as pct_accounts_using_integrations
from gtm_lab.events
group by 1
order by 1;
- Click the Chart tab under the results and choose a line chart: week on the bottom, percentage up the side.
- Change
'Integration Connected'to'Task Automated'and run again. Compare the two curves. - Write two sentences: which feature is more widely adopted, and what you would do to raise the weaker one.
What you should see: a line between roughly 10% and 60%. A healthy feature climbs and then levels off. A flat line near zero means people cannot find it, do not need it, or it is broken.
Turn the score into a sales alert
- Open a new BigQuery query tab, paste this PQL score query and click Run. It scores every account active in the last 7 days using fit, usage and intent:
with usage as (
select account_id,
count(distinct user_id) as active_users,
countif(event_name in ('Report Created', 'Integration Connected')) as key_actions_7d,
countif(event_name in ('Pricing Page Viewed', 'Plan Limit Reached')) > 0 as intent
from gtm_lab.events
where event_at >= timestamp_sub(current_timestamp(), interval 7 day)
group by account_id
)
select a.account_id, a.name, a.employees,
round(
case when a.employees between 50 and 1000 then 30
when a.employees between 10 and 49 then 15 else 0 end -- fit (max 30)
+ least(u.active_users / 5, 1) * 20 -- usage: people (max 20)
+ least(u.key_actions_7d / 25, 1) * 35 -- usage: actions (max 35)
+ if(u.intent, 15, 0)) as pql_score -- intent (max 15)
from gtm_lab.accounts a
join usage u using (account_id)
order by pql_score desc
limit 10;
- Take the top account. Send it to your Stage 2 router as an alert. Replace the URL and the values with yours:
curl -X POST "https://signal-router.YOURNAME.workers.dev" -H "Content-Type: application/json" \
-d '{"event_id":"pql_acct_9_wk45","company":"Acme 9","domain":"company9.com","employees":150,"country":"US","page":"/pricing","visits_7d":3}'
- Write in your notes how you would make this automatic: run the query daily (BigQuery Schedule button), sync
pql_scoreto the CRM with reverse ETL (Lab 1.4), and alert only on accounts that just crossed 70. - Level up: move the query into your dbt project as
models/marts/pql_scores.sql, replacinggtm_lab.eventswith a staging model.
What you should see: a ranked list of 10 accounts with scores out of 100, and a Slack alert for the top one. Each month, compare: of last month's PQLs, how many converted? Adjust the weights until the score predicts well.
Common mistakes
- Tracking everything ("Button Clicked") and understanding nothing. Start with 8–12 meaningful events.
- Inconsistent names:
report_created,Created ReportandreportCreatefor the same thing. - Scoring users, not accounts. In B2B, the company buys.
- Never checking if PQLs actually convert. A score nobody validates is a guess.
Proof of work
PQL system teardown
- Your tracking plan as a shared sheet.
- The Aha-moment SQL and the retention table (sample data is fine; say so).
- A one-page "PQL definition" with weights, threshold and how you would validate it.
Check yourself
Stage checklist
Stage 06 · Product & money
Usage-Based Pricing & Monetization
Charge customers in line with the value they get, by measuring usage and billing for it automatically.
Learning outcomes
By the end of this lecture you should be able to:
- Compare seat-based, usage-based, hybrid, credit-based and outcome-based pricing models.
- Define a value metric and evaluate candidate metrics against standard criteria.
- Explain the main methods of pricing research (Van Westendorp, Gabor–Granger, conjoint).
- Describe the architecture of a metering and billing system, including aggregation, idempotency and invoicing.
- Explain credit systems, ledgers and breakage, and the accounting implications of prepaid usage.
- Analyse the commercial risks of usage-based pricing and the mechanisms that mitigate them.
Prerequisites: Lectures A, B and 4. Reading time: about 55 minutes, plus 8–10 hours of labs.
Lecture notes
Lecture 6: Usage-Based Pricing and Monetisation
6.1 Pricing as a GTM decision
Pricing is often treated as a finance exercise, but it is one of the most powerful GTM levers. It determines which customers can afford to start, how revenue grows within an account, which motion is economically viable (Lecture A), and how customers perceive value. Madhavan Ramanujam and Georg Tacke, in Monetizing Innovation (2016), argue that a large share of new product failures are failures of monetisation: products built without a validated understanding of what customers would pay for and how. Pricing has three elements: the pricing model (what the customer pays for), the price level (how much) and packaging (which features and limits are grouped into which plans).
6.2 Pricing models
| Model | Customer pays for | Strengths | Weaknesses |
|---|---|---|---|
| Seat-based | Each user | Predictable revenue and bills; simple to understand | Discourages adding users; misaligned when software or AI does the work |
| Usage-based (UBP) | Consumption of a metered unit | Low entry cost; revenue grows with customer value | Revenue and bills are variable; requires metering infrastructure |
| Hybrid | Base platform fee plus usage | Combines predictability with growth | More complex to explain and bill |
| Credits | Prepaid units spent on various actions | Cash up front; one currency for many actions | Abstract to buyers; requires a ledger and expiry rules |
| Outcome-based | A verified business result | Strongest alignment with customer value | Requires agreed outcome definitions and attribution |
Usage-based pricing is long established in infrastructure (cloud computing, communications APIs, data warehouses) and has spread across software as AI has made the volume of work done by the product, rather than the number of human users, the main driver of value. Industry benchmarks consistently associate usage-based models with higher net revenue retention because revenue expands automatically as customers grow; the 2026 Aleph and Benchmarkit report cited in Lecture 9 found a median NRR of 108% for usage-based companies versus 98% for seat-based companies.
6.3 The value metric
The value metric is the unit on which price scales. Choosing it is the most consequential pricing decision, because it determines how revenue relates to customer success. A strong value metric satisfies four criteria:
- Aligned with value: customers who consume more receive proportionally more value.
- Understandable and predictable: buyers can estimate their bill before committing.
- Scales with the customer: consumption grows as the customer's business grows.
- Measurable and auditable: the seller can count it reliably and the customer can verify it.
Metrics that fail these criteria create predictable problems. A metric the customer cannot predict (abstract "compute units") creates bill shock and slows purchasing approval. A metric the customer cannot control creates disputes. A metric unrelated to value (logins) creates resentment, because customers pay more without benefiting more. In practice, metrics are often chosen as proxies for value that are easier to measure: an enrichment provider charges per enriched record as a proxy for pipeline created.
6.4 Pricing research methods
Price levels should be informed by evidence of willingness to pay. Three established survey methods are used:
- Van Westendorp Price Sensitivity Meter (1976) asks four questions: at what price the product would be too cheap to trust, a bargain, getting expensive, and too expensive. The intersections of the cumulative distributions identify an acceptable price range.
- Gabor–Granger asks whether respondents would buy at a series of specific prices, producing a demand curve from which revenue-maximising price can be estimated.
- Conjoint analysis presents respondents with choices between packages that vary in features and price, and estimates the value of each feature statistically. It is the most rigorous approach for packaging decisions.
Survey methods measure stated rather than revealed preference and should be validated against behaviour, for example by testing price points in controlled experiments or analysing win rates at different discount levels.
6.5 Metering and billing architecture
Usage-based pricing requires a reliable pipeline from product activity to invoice. Its stages are:
- Instrumentation: the product emits a usage event whenever a billable action completes successfully, with a unique identifier and the customer identifier.
- Ingestion and deduplication: events are collected and duplicates removed using the identifier (Lecture B).
- Aggregation: events are summarised per customer per billing period using a defined function: sum (total units), count (number of events) or last value (for example seats at period end).
- Rating: aggregated quantities are converted into charges using price rules: flat per-unit, tiered (different prices for different bands of usage) or volume (one price for all units, determined by total volume).
- Invoicing and collection: charges are combined with fixed fees, credits and taxes into an invoice.
Stripe's metered billing implements this pipeline with meters (aggregation definitions), meter events (usage records with idempotency identifiers) and metered prices attached to subscriptions. Two design principles recur. First, only successful work should be billed; failed requests should not generate usage. Second, usage should be batched (aggregated locally and reported periodically) rather than sent one event per action, to reduce load and cost while preserving accuracy.
- const usage = new Map(); // customerId -> calls since last report
- Implements the batching principle directly: rather than calling Stripe's API once per request (which would be slow and expensive at volume), each successful call only increments an in-memory counter; the actual billing report is sent in bulk on a timer, below.
- app.use((req, res, next) => { const customer = KEYS[req.header('x-api-key')]; if (!customer) return res.status(401)...
- An Express middleware function — code that runs before every route handler. It authenticates the request (API-key lookup), and the 401 response for an unrecognised key happens here, before the actual
/v1/enrichlogic ever runs, so unauthenticated traffic never reaches, and is never billed for, real work. - res.on('finish', () => { if (res.statusCode < 400) usage.set(customer, (usage.get(customer) || 0) + 1); });
- This is the "only successful work should be billed" principle, implemented precisely: the usage counter is only incremented inside a callback that fires after the response has actually finished sending, and only when the final status code is below 400 — a request that fails partway through (and ends in a 4xx or 5xx) increments nothing, so a customer is never charged for a call that did not succeed.
- setInterval(async () => { for (const [customer, count] of usage) { usage.delete(customer); await stripe.billing.meterEvents.create({ event_name: 'api_call', identifier: randomUUID(), payload: {...} }) ... }, 60_000);
- Every 60 seconds, the batched counts are flushed to Stripe: the counter is deleted from the map before the Stripe call, not after, so that calls arriving during the (brief) network round-trip start accumulating into a fresh count rather than being lost or double-counted.
identifier: randomUUID()gives every reported batch a unique idempotency key — the "meter events... with idempotency identifiers" concept from the paragraph above, now visible as one line of real code: if this report is accidentally sent twice (a retry after a timeout, for example), Stripe can recognise the duplicate identifier and avoid double-billing the customer.
6.6 Credits and ledgers
In a credit system, customers prepay for units of a common currency, which are consumed at different rates by different actions. Credits let a product with many distinct capabilities present one price. They also produce breakage: credits purchased but never used before expiry, which increases effective revenue per unit consumed but can damage trust if perceived as unfair.
Credit balances should be implemented as an append-only ledger rather than a mutable balance field. Each purchase, consumption, refund and expiry is a separate row with a unique identifier; the balance is the sum of the ledger. This design, borrowed from double-entry bookkeeping, provides a complete audit trail, makes refunds a matter of adding a compensating entry, and makes retries safe because duplicate entries are rejected by the unique key.
There are accounting implications. Under revenue recognition standards (ASC 606 in the US and the equivalent IFRS 15), prepaid credits are typically recorded as deferred revenue and recognised as they are consumed (or as they expire), not when cash is received. Pricing design therefore interacts with financial reporting, and finance teams should be involved early.
6.7 Outcome-based pricing
Outcome-based pricing charges only when a defined result occurs. AI customer-service agents are the most visible current example: Intercom has publicly priced its Fin AI agent per resolved conversation. Outcome pricing maximises alignment but introduces three requirements: an outcome definition both parties accept; a detection and attribution mechanism that determines when the outcome occurred and that the product caused it; and a dispute process. Because outcomes often become final only after a delay (a conversation is "resolved" only if the customer does not return), charges must be held until the outcome is confirmed.
6.8 Risks of usage-based models and their mitigation
Usage-based pricing transfers revenue variability from customer to seller, which affects forecasting, sales compensation and financing. Customers face bill shock and budgeting difficulty, which can slow procurement. Mitigations include hybrid models (a committed base fee), committed-use contracts (an annual commitment drawn down by usage, often at a discount), spending alerts at thresholds such as 80% of plan, hard or soft caps, and usage dashboards that let customers monitor consumption. Sales compensation also requires redesign, since a contract's value is uncertain at signature; common approaches pay commission on committed amounts and on realised consumption.
Lecture summary
- Pricing comprises model, level and packaging, and directly shapes acquisition, expansion and motion viability.
- Usage-based and hybrid models align revenue with value and are associated with higher NRR, at the cost of variability.
- The value metric should be value-aligned, predictable, scalable and measurable.
- Van Westendorp, Gabor–Granger and conjoint methods estimate willingness to pay; behavioural tests validate them.
- Metering pipelines instrument, deduplicate, aggregate, rate and invoice; they must be exact and auditable.
- Credits require append-only ledgers and have revenue-recognition consequences; outcome pricing requires definitions, attribution and disputes.
Review and discussion questions
- Why is seat-based pricing misaligned with value for AI products? Give an example.
- Evaluate "API calls" and "contacts enriched" as value metrics for an enrichment product against the four criteria.
- Explain the difference between tiered and volume pricing with a numerical example.
- Why should a credit balance be stored as a ledger rather than a single number?
- What must be true before an outcome-based price can be charged? Apply this to an AI meeting-booking agent.
- Discuss how usage-based pricing changes forecasting and sales compensation.
Further reading
- Madhavan Ramanujam and Georg Tacke, Monetizing Innovation (2016).
- Kyle Poyar, Growth Unhinged newsletter: essays on usage-based and hybrid pricing.
- Stripe documentation, "Usage-based billing" and "Meters".
- Peter van Westendorp, "NSS Price Sensitivity Meter" (ESOMAR Congress, 1976).
- FASB ASC 606 / IFRS 15 summaries on revenue recognition for prepaid and usage contracts.
In one sentence
Choose the unit of value customers care about, count it every time it happens, send those counts to the billing system, and let invoices follow usage.
The big idea
Old SaaS pricing charged per seat: $50 per user per month. That breaks when AI does the work, because one user might run 10 or 10,000 tasks. Usage-based pricing (UBP) charges for the thing that creates value: API calls, emails sent, records enriched, tasks resolved.
Customers like it because they start small. Companies like it because revenue grows as customers grow, without a new sales deal each time.
Words you must know
- Value metric
- The unit you charge for. It should grow when the customer gets more value.
- Hybrid pricing
- A base fee (platform or seats) plus usage on top. The most common model today.
- Metered billing
- Billing that counts usage during the period and charges at the end.
- Meter
- In Stripe, the definition of what to count and how (sum, count or last value).
- Meter event
- One usage record you send: "customer X used 25 units now".
- Credits
- Prepaid units customers buy upfront and spend down, like airtime.
- Overage
- Usage above what the plan includes, charged extra.
- Outcome-based pricing
- Charging only when a result happens, such as a support ticket resolved by AI.
How it works, step by step
Choosing a value metric
A good value metric passes four tests. Score your candidates 1–5 on each:
| Test | Question | Good example | Bad example |
|---|---|---|---|
| Value-aligned | Does more of it mean more value for the customer? | Contacts enriched | Logins |
| Easy to understand | Can a buyer predict their bill? | Emails sent | "Compute units" |
| Grows with the customer | Does it rise as their business grows? | Transactions processed | Number of projects (fixed) |
| Easy to measure | Can you count it reliably and prove it? | API requests | "Time saved" |
Try it · Usage-based invoice
Hybrid plan: base fee + included units + overage + credits
Practical labs
Set up metered billing in Stripe test mode
- Create a Stripe account at
dashboard.stripe.com/register. Make sure the Test mode toggle (top right) is on. - Go to Developers → API keys and copy the Secret key starting with
sk_test_. In Git Bash/Terminal, save it:export STRIPE_KEY="sk_test_..." - Create a meter. This says: count events named
api_call, add up theirvalue, and find the customer fromstripe_customer_id. Run:
curl https://api.stripe.com/v1/billing/meters \
-u "$STRIPE_KEY:" \
-d display_name="API calls" \
-d event_name=api_call \
-d "default_aggregation[formula]=sum" \
-d "customer_mapping[event_payload_key]=stripe_customer_id" \
-d "customer_mapping[type]=by_id" \
-d "value_settings[event_payload_key]=value"
- In the reply, find
"id": "mtr_..."and copy it. Now create a metered price linked to it.unit_amount_decimalis in cents, so0.5means half a cent per call:
curl https://api.stripe.com/v1/prices \
-u "$STRIPE_KEY:" \
-d currency=usd \
-d unit_amount_decimal=0.5 \
-d "recurring[interval]=month" \
-d "recurring[usage_type]=metered" \
-d "recurring[meter]=mtr_YOURMETERID" \
-d "product_data[name]=API calls"
- Copy the
price_...id from the reply. Create a customer, copy itscus_...id, then subscribe it to the price:
curl https://api.stripe.com/v1/customers -u "$STRIPE_KEY:" -d name="Acme Inc"
curl https://api.stripe.com/v1/subscriptions -u "$STRIPE_KEY:" \
-d customer=cus_YOURCUSTOMER \
-d "items[0][price]=price_YOURPRICE"
- Send usage. Each meter event says "this customer used this many units". The
identifieris a unique ID so the same event is never counted twice:
curl https://api.stripe.com/v1/billing/meter_events \
-u "$STRIPE_KEY:" \
-d event_name=api_call \
-d "payload[stripe_customer_id]=cus_YOURCUSTOMER" \
-d "payload[value]=25" \
-d identifier=req_0001
- Send 3 more events with new identifiers (
req_0002,req_0003…) and different values. Then sendreq_0001again and note the error. - In the Dashboard, go to Customers → Acme Inc and look at the upcoming invoice.
What you should see: the upcoming invoice shows the total units and the amount. Repeating an identifier is rejected, which protects customers from double billing. Stripe processes meter events in the background, so the total can take a few minutes to update.
Meter your own API
- Create a new Node project:
cd ~/gtm-labs
mkdir meter-api
cd meter-api
npm init -y
npm install express stripe
code .
- In VS Code, open
package.jsonand add the line"type": "module",just below the"name"line. Save. - Create
server.js, paste the code below, and replacecus_YOURCUSTOMERwith the customer id from Lab 6.1. Save.
import express from 'express';
import Stripe from 'stripe';
import { randomUUID } from 'node:crypto';
const stripe = new Stripe(process.env.STRIPE_KEY);
const app = express();
const usage = new Map(); // customerId -> calls since last report
// Map API keys to Stripe customers (use a database in real life)
const KEYS = { 'demo_key_123': 'cus_YOURCUSTOMER' };
app.use((req, res, next) => {
const customer = KEYS[req.header('x-api-key')];
if (!customer) return res.status(401).json({ error: 'Invalid API key' });
res.on('finish', () => {
if (res.statusCode < 400) usage.set(customer, (usage.get(customer) || 0) + 1);
});
next();
});
app.get('/v1/enrich', (req, res) => res.json({ company: 'Acme', employees: 120 }));
// Every 60 seconds, report the batch to Stripe
setInterval(async () => {
for (const [customer, count] of usage) {
usage.delete(customer);
await stripe.billing.meterEvents.create({
event_name: 'api_call',
identifier: randomUUID(),
payload: { stripe_customer_id: customer, value: String(count) }
});
console.log(`Reported ${count} calls for ${customer}`);
}
}, 60_000);
app.listen(3000, () => console.log('API on http://localhost:3000'));
- Start the server (in the same terminal where you set
STRIPE_KEYin Lab 6.1, or set it again):node server.js - Open a second Git Bash/Terminal window and call your API a few times, plus once with a wrong key:
curl -H "x-api-key: demo_key_123" http://localhost:3000/v1/enrich
curl -H "x-api-key: demo_key_123" http://localhost:3000/v1/enrich
curl -H "x-api-key: demo_key_123" http://localhost:3000/v1/enrich
curl -H "x-api-key: wrong_key" http://localhost:3000/v1/enrich
- Wait one minute and watch the first window.
What you should see: the first window prints Reported 3 calls for cus_.... The wrong-key call returns Invalid API key and is not billed. A few minutes later, the 3 calls appear on Acme's upcoming invoice in Stripe. Stop the server with Ctrl + C.
Design a credit system
Credits work like airtime: buy upfront, spend per action, top up. Clay and many AI tools use them. The golden rule is a ledger: never overwrite a balance, only add rows.
- Sign up at
supabase.comand click New project. Pick any name, set a database password (save it; Lab 8.2 needs it), choose the region nearest you, and wait for it to finish. - In the left menu, click SQL Editor → New query. Paste this and click Run:
create table credit_ledger (
entry_id text primary key, -- unique, makes retries safe
account_id text not null,
amount integer not null, -- +1000 for a purchase, -3 for a use
reason text not null, -- 'purchase', 'enrich_contact', 'refund', 'expiry'
created_at timestamp not null default current_timestamp
);
insert into credit_ledger (entry_id, account_id, amount, reason) values
('buy_001', 'acct_9', 1000, 'purchase'),
('use_001', 'acct_9', -3, 'enrich_contact'),
('use_002', 'acct_9', -3, 'enrich_contact'),
('use_003', 'acct_9', -25, 'research_agent'),
('refund_003', 'acct_9', 25, 'refund'), -- the agent run failed, so we refund it
('buy_002', 'acct_14', 500, 'purchase');
-- Balance is always the sum of the ledger
select account_id, sum(amount) as balance
from credit_ledger group by account_id order by account_id;
- Now pretend a network retry sends the same use twice. Run only this line:
insert into credit_ledger (entry_id, account_id, amount, reason) values ('use_001', 'acct_9', -3, 'enrich_contact');
- In a Google Doc, write your one-page credit rules: price per credit pack, what each action costs, whether credits expire, and what happens at zero (block, overage, or auto top-up).
What you should see: balances of 994 for acct_9 and 500 for acct_14. The repeated insert fails with a "duplicate key" error, so the customer is never charged twice. That is why every ledger row needs a unique ID.
Sketch an outcome-based pricing architecture
Outcome pricing charges only for results, for example per support conversation an AI agent resolves without a human (Intercom's Fin agent is a well-known example). It needs more plumbing than usage pricing.
- Pick a product whose result can be counted (an AI support agent, a meeting-booking tool, a lead-enrichment API).
- Open
excalidraw.com. Draw five boxes left to right and label them with the five parts below. - Under each box, write one sentence for your product:
- Outcome definition: one sentence both sides agree on. "Resolved = customer did not ask for a human within 24 hours."
- Detection: which event proves the outcome happened, and when you can be sure.
- Waiting period: hold the charge until the outcome is final (for example 24 hours).
- Dispute path: how a customer challenges a charge, and how you reverse it.
- Reporting: a page where the customer can see every billed outcome with evidence.
- Draw arrows between the boxes in order. Add one risk under the whole drawing (for example "the AI marks things resolved too early").
- Export it as an image (menu → Export image) and add it to your portfolio repo.
What you should see: a one-picture plan a billing engineer could build from, with the definition of the outcome written so clearly that a customer could not argue with it.
Common mistakes
- Charging for a metric customers cannot predict or control. Bills shock them and they churn.
- No usage dashboard or alerts for customers. Always warn them at 80% of their plan.
- Sending one billing call per request. Batch it.
- No unique identifier on events, so retries double-bill people.
- Pure usage pricing with no base fee, so revenue swings wildly month to month.
Proof of work
Pricing redesign memo + working demo
- Pick a seat-priced SaaS tool. Propose a hybrid usage model with a value metric, scored on the 4 tests.
- Show a working Stripe test-mode setup with a meter, a price and a sample invoice screenshot.
- Model 3 customer sizes and show what each would pay before and after.
Check yourself
Stage checklist
Stage 07 · Measure & enable
Multi-Touch Attribution & RevOps
Use SQL to answer the questions leaders ask every week: what brought in revenue, where do deals get stuck, and is our spending paying off?
Learning outcomes
By the end of this lecture you should be able to:
- Explain the purpose and scope of Revenue Operations and the importance of shared metric definitions.
- Describe the attribution problem and compare rule-based, data-driven and experimental approaches.
- Calculate single-touch, linear, U-shaped, W-shaped and time-decay attribution.
- Explain Markov-chain and Shapley-value attribution, marketing mix modelling and incrementality testing.
- Analyse funnel conversion and pipeline velocity, and locate leakage.
- Construct and interpret cohort retention analyses, and design a decision-oriented dashboard.
Prerequisites: Lectures A, B and 1. Reading time: about 60 minutes, plus 12 hours of labs.
Lecture notes
Lecture 7: Multi-Touch Attribution and RevOps
7.1 Revenue Operations
Revenue Operations (RevOps) is the function responsible for the systems, data, processes and analytics that support the entire revenue organisation. It emerged in the late 2010s from the consolidation of separate sales operations, marketing operations and customer success operations teams. The rationale is that a revenue process crosses departmental boundaries, so its measurement and tooling should not be fragmented by department.
The foundation of RevOps is shared definitions. Every metric used in decisions (MQL, SQL, opportunity, pipeline, win rate, churn, ARR) must have a single written definition, a single source of computation and an owner. Without them, departments report different numbers for the same concept and decision-making stalls. A metrics dictionary or semantic layer, which defines each metric once in code for reuse across dashboards, is a common implementation.
7.2 The attribution problem
Attribution assigns credit for an outcome (a sale, an opportunity) to the marketing and sales interactions that preceded it. Its purpose is to guide resource allocation: which channels and programmes should receive more or less investment. The problem is difficult for structural reasons. B2B purchases involve several people over months, with many interactions, some of which are not tracked (Lecture 12). Interactions also interact: a webinar may only work because the prospect previously read a blog post. Any attribution model is therefore a simplification, and the choice of model embeds assumptions about how influence works.
7.3 Rule-based attribution models
Rule-based models assign credit by fixed position-based rules:
| Model | Rule | Implicit assumption |
|---|---|---|
| First-touch | 100% to the first interaction | Creating awareness is what matters |
| Last-touch | 100% to the final interaction before conversion | The closing interaction is what matters |
| Linear | Equal shares to all interactions | Every interaction contributes equally |
| U-shaped (position-based) | 40% first, 40% lead-creation, 20% shared among the middle | Starting and converting matter most |
| W-shaped | About 30% each to first touch, lead creation and opportunity creation; remainder shared | Three milestones matter most |
| Time-decay | Credit decreases exponentially with time before conversion | Recent interactions matter most |
In time-decay attribution, a touch occurring d days before conversion receives weight 2−d/h, where h is the half-life; weights are normalised to sum to one. Rule-based models are transparent and easy to compute in SQL with window functions (ROW_NUMBER and COUNT … OVER (PARTITION BY opportunity)), which is why they remain widely used. Their weakness is that the rules are chosen, not learned.
- count(*) over (partition by tp.opportunity_id) as n_touches
- A window function (Lecture B.4): unlike a
group byaggregation, which would collapse multiple touch rows per deal into one row,over (partition by ...)computes the count per deal while leaving every individual touch row intact — each touch row ends up knowing how many total touches its deal had, which is exactly what the linear formula (amount ÷ n_touches) needs row by row. - where o.stage = 'Closed Won' and tp.touched_at <= o.closed_at
- Two filters doing different jobs: only won deals have revenue to attribute at all, and the time filter excludes any touch recorded after the deal closed — without it, a post-sale touchpoint (a renewal check-in logged against the same opportunity record) could wrongly receive credit for having caused a sale that already happened.
- select channel, round(sum(amount / n_touches)) as linear_revenue from t group by channel
- Implements the linear rule directly: each row's own slice (
amount / n_touches, computed per touch) is summed up per channel — because every touch on a given deal carries the samen_touchesvalue from the window function above, this correctly divides the deal's revenue evenly across however many touches it had. - row_number() over (partition by tp.opportunity_id order by tp.touched_at) as pos
- A second window function assigns each touch a sequential position (1st, 2nd, 3rd...) within its own deal, ordered by time — this
posvalue is what the U-shapedcase whenlogic below uses to identify "first touch" (pos = 1) and "last touch" (pos = n). - case when n = 1 then 1.0 when n = 2 then 0.5 when pos = 1 or pos = n then 0.4 else 0.2 / (n - 2) end as weight
- Encodes the U-shaped rule from the table above as four explicit cases, handling the edge cases the simple "40/40/20" description glosses over: a deal with only one touch must give it all the credit (
1.0, since there is no "first vs. last" distinction to make); a deal with exactly two touches splits 50/50 (since there are no middle touches to hold the remaining 20%); only deals with three or more touches use the full 40/40/20 split, with the 20% middle share divided evenly among however many middle touches exist (n - 2of them). - select channel, round(sum(amount * weight)) as u_shaped_revenue from w group by channel
- The same per-row-then-aggregate pattern as the linear query: each touch's dollar share (
amount * weight) is computed individually using that row's own weight, then summed per channel — which is also exactly why both queries' totals must match (as the lab's step 5 asks the learner to verify): every touch's weight was constructed to sum to 1.0 across its own deal, so redistributing by weight never creates or destroys revenue, only reallocates which channel it is credited to.
7.4 Data-driven and experimental approaches
Data-driven attribution learns credit from the data rather than applying fixed rules. Two methods are common:
- Markov-chain attribution models customer journeys as transitions between channels and computes each channel's removal effect: how much the overall conversion rate would fall if that channel were removed from all paths.
- Shapley-value attribution, from cooperative game theory (Lloyd Shapley, 1953), assigns each channel its average marginal contribution across all possible orderings of channels, satisfying formal fairness properties.
Google Analytics 4 adopted data-driven attribution as its default and, in 2023, removed the first-click, linear, time-decay and position-based models from the product, which illustrates the industry's movement toward learned models. Data-driven models still measure association, not causation, and require substantial volumes of conversions to be stable.
Two further approaches address causality more directly. Marketing mix modelling (MMM) uses regression on aggregate time series (spend by channel, sales, seasonality) to estimate each channel's contribution, without relying on user-level tracking. Open-source implementations include Meta's Robyn and Google's Meridian. Incrementality testing uses controlled experiments, such as holdout groups or geographic tests in which a channel is paused in some regions, to measure the causal lift a channel produces. Experiments are the strongest evidence but are slower and more expensive, so mature teams use attribution for routine monitoring and experiments to validate major decisions.
7.5 Funnel analysis and pipeline velocity
Funnel analysis measures the number of records entering each lifecycle stage and the conversion rate between consecutive stages. The stage with the lowest conversion relative to its own history or to benchmarks is the constraint; improving a non-constraining stage produces little gain. Segmenting conversion rates by source, segment, region and representative reveals where leakage originates. Conversion rates should be computed on cohorts (leads created in the same period, followed through), because comparing stage counts within a single calendar period mixes records at different ages.
Pipeline velocity summarises how quickly the pipeline produces revenue:
The formula makes explicit the four levers available to a revenue team, and shows that shortening the sales cycle is mathematically equivalent to increasing volume.
7.6 Cohort analysis
A cohort is a group defined by a shared starting event in the same period, such as all customers acquired in March. Cohort analysis follows each group over time, typically presented as a triangular table with cohorts as rows and months since start as columns. It reveals patterns that aggregate metrics conceal. A stable total customer count may hide high churn masked by strong acquisition; a declining average retention may reflect a change in customer mix rather than worse retention. Comparing retention curves across cohorts shows whether product or onboarding changes improved outcomes: if newer cohorts retain better at the same age, the change worked. Revenue cohorts (summing MRR rather than counting accounts) additionally show whether expansion outweighs churn.
7.7 Dashboards for decisions
A dashboard is valuable only if it changes decisions. Effective GTM dashboards follow a consistent hierarchy: headline outcomes first (new ARR, pipeline created, win rate, payback), then the drivers of those outcomes (channel contribution, funnel conversion, cohort retention), then detail on demand. Each chart should answer a named question. Every metric should link to its definition. Written commentary, stating what changed, why and what is recommended, converts a report into an argument. Edward Tufte's principle of maximising the data-ink ratio (devoting the ink in a graphic to data rather than decoration) remains a useful discipline.
Lecture summary
- RevOps unifies revenue systems and data; shared metric definitions are its foundation.
- Attribution allocates credit across interactions; every model embeds assumptions and none is ground truth.
- Rule-based models are transparent and computable in SQL; data-driven models (Markov, Shapley) learn credit from journeys.
- MMM and incrementality experiments address causation; experiments provide the strongest evidence.
- Funnel analysis locates the constraining stage; pipeline velocity expresses the four levers of revenue output.
- Cohort analysis separates retention from acquisition effects; dashboards should be structured around decisions.
Review and discussion questions
- Why is attribution inherently ambiguous in B2B sales?
- Calculate linear and U-shaped attribution for a $30,000 deal with five touches.
- Explain the removal effect in Markov-chain attribution.
- When would you choose incrementality testing over an attribution model, and why?
- Explain why computing funnel conversion within a single calendar month can mislead.
- Sketch a cohort table in which total customers grow but retention is worsening.
Further reading
- Google Analytics Help, "Get started with attribution" and the 2023 attribution model changes.
- L. S. Shapley, "A Value for n-Person Games" (1953).
- Meta, Robyn documentation; Google, Meridian documentation (marketing mix modelling).
- Edward R. Tufte, The Visual Display of Quantitative Information (1983).
- E. Anderl, I. Becker, F. von Wangenheim and J. H. Schumann, "Mapping the customer journey: Lessons learned from graph-based online attribution modeling", International Journal of Research in Marketing (2016).
In one sentence
Record every touch a buyer had before they paid, share the credit for the revenue across those touches with a clear rule, and show leaders where money comes from and where it leaks.
The big idea
A B2B buyer rarely buys after one ad. They read a blog post, see a LinkedIn post, attend a webinar, get a cold email, then book a demo. Which one "caused" the sale? Attribution is the set of rules for sharing that credit.
No model is "true". Each is a lens. Your job is to pick sensible lenses, explain them simply, and help leaders make better decisions, such as moving budget from a channel that never starts deals to one that does.
Words you must know
- Touchpoint
- One interaction with a buyer: ad click, webinar, email reply, demo.
- First-touch
- 100% credit to the first interaction.
- Last-touch
- 100% credit to the final interaction before conversion.
- Linear
- Equal credit to every touch.
- U-shaped
- 40% first, 40% last (the lead-creating touch), 20% shared by the middle.
- W-shaped
- Like U-shaped plus a big share for the touch that created the opportunity.
- Time-decay
- Touches closer to the sale get more credit.
- Funnel leakage
- Where prospects drop out between stages, such as demo booked → demo held.
- Cohort
- A group that started at the same time, like "everyone who signed up in March".
- CAC payback
- Months of gross profit needed to earn back what you spent to win a customer.
Try it · Attribution model comparer
One $24,000 deal, four touches. Who gets the credit?
Practical labs
SQL survival kit for GTM
- Open a new query tab and paste all six queries below.
- Highlight one query at a time (from
selectto its;) and click Run. Read the result before moving on. - After each one, change one thing and run it again: a different date range, a different column to group by, or
desctoasc. - Close this page and rewrite query 2 and query 4 from memory. Repeat until you can.
-- 1. Filter and count: how many deals did we win in the last 90 days?
select count(*) as deals_won
from gtm_lab.opportunities
where stage = 'Closed Won' and closed_at >= timestamp_sub(current_timestamp(), interval 90 day);
-- 2. Group: revenue by source
select lead_source, sum(amount) as revenue
from gtm_lab.opportunities where stage = 'Closed Won'
group by lead_source order by revenue desc;
-- 3. Join: attach the account's industry to each deal
select o.opportunity_id, a.industry, o.amount
from gtm_lab.opportunities o join gtm_lab.accounts a on o.account_id = a.account_id
limit 20;
-- 4. Conditional count: win rate per rep
select owner, round(countif(stage = 'Closed Won') / count(*) * 100, 1) as win_rate_pct
from gtm_lab.opportunities
where stage in ('Closed Won', 'Closed Lost')
group by owner order by win_rate_pct desc;
-- 5. Window function: number each touch in order per deal
select opportunity_id, channel, touched_at,
row_number() over (partition by opportunity_id order by touched_at) as touch_no
from gtm_lab.touchpoints
order by opportunity_id, touch_no
limit 20;
-- 6. Date bucket: deals created per month
select date_trunc(date(created_at), month) as month, count(*) as deals_created
from gtm_lab.opportunities group by 1 order by 1;
What you should see: a small results table for each question: won deals in the last 90 days, revenue by lead source, deals with their industry, win rate per rep, touches numbered in order, and deals created per month. Write one sentence of insight under each, like "Partner deals bring the most revenue per deal."
Build linear and U-shaped attribution in SQL
- Look at the raw data first: run
select * from gtm_lab.touchpoints order by opportunity_id, touched_at limit 30. Each deal has 2–6 marketing touches before it closed. - Run linear attribution. Each touch gets the deal amount ÷ number of touches:
with t as (
select tp.opportunity_id, tp.channel, o.amount,
count(*) over (partition by tp.opportunity_id) as n_touches
from gtm_lab.touchpoints tp
join gtm_lab.opportunities o using (opportunity_id)
where o.stage = 'Closed Won' and tp.touched_at <= o.closed_at
)
select channel, round(sum(amount / n_touches)) as linear_revenue
from t group by channel order by linear_revenue desc;
- Run U-shaped attribution. First and last touches get 40% each, middle touches share 20%. One touch gets 100%; two touches get 50% each:
with t as (
select tp.opportunity_id, tp.channel, o.amount,
row_number() over (partition by tp.opportunity_id order by tp.touched_at) as pos,
count(*) over (partition by tp.opportunity_id) as n
from gtm_lab.touchpoints tp join gtm_lab.opportunities o using (opportunity_id)
where o.stage = 'Closed Won' and tp.touched_at <= o.closed_at
),
w as (
select *,
case
when n = 1 then 1.0
when n = 2 then 0.5
when pos = 1 or pos = n then 0.4
else 0.2 / (n - 2)
end as weight
from t
)
select channel, round(sum(amount * weight)) as u_shaped_revenue
from w group by channel order by u_shaped_revenue desc;
- Copy both result tables into one Google Sheet, side by side: Channel, Linear $, U-shaped $.
- Check your maths: both columns should add up to the same total (all won revenue). Then write two sentences on which channel gains most under U-shaped, and why.
What you should see: both columns add up to the same total (all won revenue), but some channels gain under U-shaped and others lose. Channels that often start or close deals gain; channels that usually sit in the middle of the journey lose. Name one of each in your sentence.
Find funnel leakage
- Run the funnel query. It counts leads at each stage over the last year and the conversion between stages:
select
count(*) as leads,
count(mql_at) as mqls,
count(sql_at) as sqls,
count(opp_at) as opps,
count(won_at) as wins,
round(count(mql_at) / count(*) * 100, 1) as lead_to_mql_pct,
round(count(sql_at) / nullif(count(mql_at), 0) * 100, 1) as mql_to_sql_pct,
round(count(opp_at) / nullif(count(sql_at), 0) * 100, 1) as sql_to_opp_pct,
round(count(won_at) / nullif(count(opp_at), 0) * 100, 1) as opp_to_win_pct
from gtm_lab.leads
where created_at >= timestamp_sub(current_timestamp(), interval 365 day);
- Find the stage with the lowest conversion. That is the leak.
- Split the leak by source to see who leaks most:
select source,
count(mql_at) as mqls,
round(count(sql_at) / nullif(count(mql_at), 0) * 100, 1) as mql_to_sql_pct,
round(count(won_at) / nullif(count(opp_at), 0) * 100, 1) as opp_to_win_pct
from gtm_lab.leads
group by source
order by mql_to_sql_pct;
- Write a 3-line note: the leakiest stage, the worst source at that stage, and one fix you would test.
What you should see: about 3,000 leads narrowing to a few dozen wins. The two weakest steps are MQL → SQL and opportunity → won, both around 25–30%. nullif stops a divide-by-zero error when a stage is empty.
Cohort retention table
- Run this query. Each row is "customers who started in month X, N months later":
with first_month as (
select account_id, min(month) as cohort_month
from gtm_lab.subscriptions_monthly group by account_id
)
select f.cohort_month,
date_diff(s.month, f.cohort_month, month) as months_since_start,
count(distinct s.account_id) as active_accounts,
sum(s.mrr) as mrr
from gtm_lab.subscriptions_monthly s join first_month f using (account_id)
group by 1, 2
order by 1, 2;
- Above the results, click Save results → Google Sheets (or CSV, then import it into a sheet).
- In Google Sheets, select the data and click Insert → Pivot table. Set Rows =
cohort_month, Columns =months_since_start, Values =active_accounts(SUM). - Select the numbers in the pivot and click Format → Conditional formatting → Color scale.
- Read across each row: how many customers from that month are still paying after 3, 6 and 12 months?
What you should see: a triangle-shaped heatmap. Rows shrink as customers churn. Newer cohorts holding on better than older ones is the best news a dashboard can show. Try Values = mrr too: if a row grows over time, expansion beats churn.
Build the ROI proof dashboard
- Open
lookerstudio.google.comand click Blank report. When asked for data, choose BigQuery → your project →gtm_lab→opportunities, then Add. - Headline numbers: click Add a chart → Scorecard four times. Set metrics to Record Count, SUM of amount, and AVG of cycle_days. Add a filter
stage = Closed Wonto the revenue card. - Revenue by channel: add a Bar chart with Dimension =
lead_source, Metric = SUM ofamount, filtered to Closed Won. - Win rate by rep: add a Table with Dimension =
ownerand Dimension =stage, Metric = Record Count. - Funnel: click Add data, add the
leadstable, and add a Bar chart showing COUNT ofmql_at,sql_at,opp_atandwon_at. - Notes box: click Insert → Text and write 3 sentences: what changed, the biggest leak, and what you recommend.
- Click Share → Manage access, set "Anyone with the link can view", and copy the link for your portfolio.
What you should see: a one-page dashboard a leader understands in 30 seconds: headline numbers on top, revenue by channel, rep performance, funnel, and your written recommendation.
Common mistakes
- Presenting one model as "the truth". Always show at least two and explain the gap.
- Counting touches that happened after the deal closed.
- Dividing by zero in conversion rates. Use
nullif. - Ignoring untrackable channels (podcasts, word of mouth). That is what Stage 12 fixes.
- A dashboard with 30 charts and no recommendation.
Proof of work
Revenue truth dashboard
- A public Looker Studio dashboard on sample data with the five sections above.
- Your SQL in a GitHub repo, one file per question.
- A short memo: "If I were head of marketing, I would move $X from A to B because…"
Check yourself
Stage checklist
Stage 08 · Measure & enable
AI Sales Enablement & Coaching
Turn hundreds of recorded sales calls into a searchable brain: instant summaries, live battlecards, and coaching that repeats until reps get better.
Learning outcomes
By the end of this lecture you should be able to:
- Explain how conversation intelligence platforms turn recorded calls into structured data, and read the API code that pulls transcripts out of one.
- Define text embeddings and vector similarity precisely, and explain, line by line, how a chunking-and-embedding pipeline is implemented.
- Explain retrieval-augmented generation (RAG) as an architecture, derive cosine distance, and read the SQL behind a nearest-neighbour vector search.
- Design a grounded, schema-constrained LLM extraction prompt and explain why unconstrained summarisation produces hallucination risk.
- Explain the information structure of a competitive battlecard and how it is assembled from retrieved evidence.
- Apply the theory of deliberate practice to design a coaching reinforcement loop, and critique one against that theory.
Prerequisites: Lectures A, B (especially B.5 on LLM mechanics) and 1 (especially identity resolution and the warehouse). Reading time: about 60 minutes, plus 10–12 hours of labs.
Lecture notes
Lecture 8: AI Sales Enablement and Coaching
8.1 Conversation intelligence as a data problem
Conversation intelligence platforms (Gong, Chorus, Clari Copilot) record, transcribe and structure sales conversations. Before any AI is applied, the platform already performs three non-trivial engineering tasks: automatic speech recognition (audio to text), speaker diarisation (assigning each span of text to a speaker, which is hard on multi-party calls with cross-talk), and topic and moment detection (tagging segments as "pricing discussion", "competitor mention", and so on, usually with a fine-tuned classifier). The GTM engineer's job starts one layer above this: treating the output as a data source to be extracted via API, stored, and queried like any other dataset, rather than only browsed inside the vendor's own UI.
This matters because a vendor's native search is usually keyword-based and confined to one call at a time. The opportunity is to aggregate transcripts across hundreds or thousands of calls and ask questions that span the whole corpus — "how do buyers react when we mention price," "what do we say about RivalCo and does it work" — which requires exporting the data and building retrieval infrastructure, covered in §8.2–7.4.
8.2 Extracting data via a vendor API
Lab 8.1 pulls transcripts from the Gong API. The design follows the authentication and pagination patterns established in Lecture B.2: Basic Auth with a key/secret pair issued by an admin, a time-bounded filter rather than "all calls ever" (bounding both cost and the size of a single response), and a cursor field for pagination on large result sets. The code is reproduced below with each part explained.
- BASE = "https://api.gong.io"
- The API's base host. Every endpoint path is appended to this. Keeping it as one variable means a sandbox or EU-region host can be swapped in one place.
- AUTH = (os.environ["GONG_ACCESS_KEY"], os.environ["GONG_SECRET"])
- Builds a Python tuple that the
requestslibrary turns into an HTTP Basic Authorization header automatically when passed asauth=. Reading fromos.environrather than hard-coding the key means the secret never appears in the source file, so it is safe to commit the script to Git (the secret itself must never be committed). - resp = requests.post(f"{BASE}/v2/calls/transcript", auth=AUTH, json={...}, timeout=60)
- A POST request (Lecture B.1: this endpoint is a query, but Gong's API design uses POST so a complex filter object can be sent as a JSON body rather than cramped into a query string).
json={...}serialises the Python dict to a JSON body and sets the Content-Type header for you.timeout=60is defensive: without a timeout, a stalled connection would hang the script forever. - "fromDateTime" / "toDateTime"
- The filter object. Bounding the date range keeps the response size manageable and lets the script be re-run for a specific month without re-downloading everything already pulled.
- resp.raise_for_status()
- Converts any HTTP 4xx or 5xx response into a Python exception immediately. Without this line, a failed call (expired key, rate limit) would silently continue to the next line and crash later with a confusing error when the code tries to read JSON out of an error page.
- for call in data["callTranscripts"]:
- The response holds one object per call. Each call object itself contains a list of "monologues" — contiguous stretches of speech by one speaker.
- for mono in call["transcript"]:
- Iterates the monologues inside one call.
- text = " ".join(s["text"] for s in mono["sentences"])
- Gong returns each monologue as a list of sentence objects (so that each sentence carries its own timestamp). This line is a generator expression inside
join: it produces each sentence's text one at a time and" ".join(...)glues them into one string separated by spaces — a common Python idiom for "concatenate a list of strings efficiently." - rows.append({"call_id": ..., "speaker_id": ..., "text": text})
- Flattens the nested call → monologue → sentence structure into one flat row per monologue. Flattening nested JSON into flat rows is the same transformation a reverse-ETL or ingestion pipeline performs (Lecture 1.4) — nested data is good for an API response, flat rows are what downstream SQL and chunking code expect.
- json.dump(rows, open("transcripts.json", "w"), indent=2)
- Serialises the Python list back to JSON and writes it to disk.
indent=2makes the file human-readable at the cost of a slightly larger file — reasonable for a dataset this size, not for production-scale exports. - # If data has a "records" → "cursor" value...
- A comment flagging the part deliberately left incomplete: production code would loop, following the cursor until the API reports no more pages, exactly as described generically in Lecture B.2's treatment of cursor-based pagination.
8.3 Text embeddings
An embedding is a fixed-length vector of real numbers produced by a neural network such that texts with similar meaning are mapped to nearby points in that vector space, and texts with different meaning are mapped to distant points. This idea has a direct intellectual lineage: Landauer and Dumais's latent semantic analysis (1997) first showed that word co-occurrence statistics could be compressed into a low-dimensional space that captured meaning; Mikolov et al.'s word2vec (2013) showed the same idea trained efficiently at scale with neural networks, producing the now-famous result that vector arithmetic captures relationships (king − man + woman ≈ queen); modern sentence/document embedding models (such as OpenAI's text-embedding-3-small used in Lab 8.2) extend this to whole passages using transformer architectures.
Lab 8.2 implements the standard two-stage ingestion pipeline for retrieval: chunking (splitting long text into passages small enough to embed meaningfully and retrieve granularly) followed by embedding and storage. The chunk size (about 250 words in the lab) trades off two failure modes: chunks that are too large dilute a specific answer among unrelated surrounding text (hurting retrieval precision); chunks that are too small lose the surrounding context needed to make sense of a retrieved fragment (hurting usefulness). 200–400 words per chunk is a common practical range for this trade-off; the correct value for a given corpus is an empirical question, tuned by inspecting retrieval quality.
- client = OpenAI()
- Constructs an API client that reads
OPENAI_API_KEYfrom the environment automatically — the same "read the secret from the environment, never hard-code it" pattern as Lab 8.1. - def chunks(rows, max_words=250):
- A generator function — it uses
yieldinstead ofreturn, so calling it does not immediately process everything; it produces one chunk at a time as the caller asks for the next one. This keeps memory use flat regardless of how many transcripts are processed. - if call and r["call_id"] != call and buf:
- Detects a call boundary: if the row belongs to a different call than the one currently being accumulated, the buffer so far is flushed as a finished chunk before starting a new one. This guarantees a chunk never silently mixes text from two different calls.
- buf.append(f'{r["speaker_id"]}: {r["text"]}')
- Keeps the speaker label attached to each line inside the chunk, so that when a chunk is later shown to a human or to an LLM, "who said this" is preserved — losing speaker attribution would make objection-handling analysis (§8.6) impossible.
- if sum(len(t.split()) for t in buf) >= max_words: yield ...
- Counts words across everything accumulated so far (
t.split()splits each buffered line on whitespace andlen(...)counts the resulting words) and flushes the buffer once the running total reaches the target size. This is a simple greedy chunker; production systems often chunk on sentence or paragraph boundaries instead of a raw word count to avoid cutting a sentence in half. - vec = client.embeddings.create(model=..., input=text).data[0].embedding
- Sends one chunk of text to the embedding model and receives back a list of 1,536 floating-point numbers (for
text-embedding-3-small) — the vector described in the theory above..data[0]because the API's response shape supports batching multiple inputs in one call; here only one input was sent. - conn.execute("insert into call_chunks (...) values (%s, %s, %s::vector)", (call_id, text, str(vec)))
- Writes the chunk's text and its vector into Postgres.
%splaceholders (not Python f-string interpolation) are used deliberately: this is parameterised SQL, which prevents SQL injection and correctly handles special characters in the transcript text.::vectorcasts the string representation of the Python list into pgvector's native vector type on the database side.
(call_id, chunk_index); a production version would add one.8.4 Vector search and retrieval-augmented generation
Similarity between two embedding vectors a and b is most commonly measured by cosine similarity: the cosine of the angle between them, cos θ = (a·b) / (‖a‖‖b‖), which ranges from −1 (opposite meaning) to 1 (identical direction, i.e. identical meaning as the model represents it). pgvector exposes the complementary quantity, cosine distance (1 − cosine similarity, written <=>), so that ordering by ascending distance returns the closest — most similar — rows first, consistent with how a standard SQL order by ... limit n nearest-neighbour query is written.
Lab 8.3's search script and the broader design are an implementation of retrieval-augmented generation (RAG), formalised by Lewis et al., "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks" (NeurIPS, 2020). RAG's architectural insight is to separate two jobs an LLM is bad at doing together: remembering specific facts (an LLM's internal "memory" is lossy and dated) and reasoning in natural language over facts it is given (an LLM is good at this). RAG hands the first job to a retrieval system — here, vector search over a warehouse the organisation actually controls and can audit — and the second job to the LLM, which only ever sees the small number of passages the retrieval step selected.
- qvec = str(client.embeddings.create(...).data[0].embedding)
- The question is embedded with the same model used to embed the stored chunks in Lab 8.2 — this is essential: comparing vectors from two different embedding models is meaningless, because each model defines its own vector space.
- select call_id, left(text, 300), 1 - (embedding <=> %s::vector) as similarity
left(text, 300)truncates the returned text for readable console output.1 - distanceconverts pgvector's distance metric back into the more intuitive similarity score (closer to 1 = more similar) described above, purely for human readability — it changes nothing about the ranking.- order by embedding <=> %s::vector limit 5
- This is the retrieval step of RAG: find the 5 stored chunks whose vectors are closest to the question's vector. The database does this efficiently using an index on the vector column (pgvector supports approximate nearest-neighbour indexes for large tables; at lab scale a full scan is fine).
8.5 Grounded extraction and the hallucination problem
Lecture B.5 introduced LLM hallucination: a model will produce fluent, confident, and sometimes entirely fabricated content when asked a question its training or context does not actually answer. Automated call summarisation is a high-stakes hallucination surface, because a fabricated "next step" or invented objection written into a CRM record is indistinguishable from a real one to anyone who did not listen to the call. Lab 8.4's prompt mitigates this with three disciplined techniques that generalise well beyond this specific lab:
- Schema-constrained output. The prompt specifies an exact JSON shape rather than asking for free text. A rigid schema is easier to validate programmatically and harder for the model to pad with invented colour.
- Explicit grounding instruction. "Use only what is said in the transcript. If something is not said, leave it out" directly targets the failure mode: it gives the model an explicit, cheap way to express "unknown" (omit the field) instead of an implicit pressure to fill in every field with something.
- Human verification as a control, not an afterthought. Step 3 of the lab ("check the result against the transcript... mark anything invented") treats the LLM output as a draft requiring an audit, the same discipline already established for enrichment waterfalls (Lecture 3.2) and reverse-ETL syncs (Lecture 1.5): never let an unaudited automated step write directly into a system of record without a provenance trail.
8.6 Competitive battlecards as synthesised evidence
A battlecard is a compressed decision-support artefact: a rep preparing for a call in the next five minutes needs the output of hundreds of hours of other reps' experience, instantly. Lab 8.5 constructs one by retrieval (gather every chunk mentioning a competitor, §8.4) followed by synthesis (an LLM groups and ranks the retrieved evidence into the five standard battlecard sections). The "mark anything mentioned only once as single mention" instruction is a statistical caution folded into the prompt: a pattern observed once in twenty retrieved chunks is weak evidence and should be presented with appropriately lower confidence than a pattern observed in half of them — the same reasoning that underlies confidence intervals in any small-sample inference, made actionable in a prompt instruction rather than a formula.
The "landmine questions" section deserves separate note: these are not random objection-handling tips but questions constructed to expose a competitor's specific weak point, discovered empirically from calls where that competitor was discussed and lost (or won) — the battlecard converts observed conversational evidence into a forward-looking sales tactic, which is the general pattern of all the enablement work in this lecture: retrieve what actually happened, then act on it.
8.7 Deliberate practice and the reinforcement loop
Lab 8.6's weekly quiz-and-score loop is an application of deliberate practice theory, most thoroughly described by K. Anders Ericsson and Robert Pool in Peak: Secrets from the New Science of Expertise (2016). Deliberate practice differs from ordinary repetition in three ways that the lab's design mirrors directly: practice must be focused on a specific, identified weakness (the lab selects the three most common real objections from actual call data, not generic sales theory); it requires immediate, specific feedback (the 1–5 score against a model answer, explained in one line); and it must be repeated with adjustment (next week's quiz targets whichever objection scored lowest, so the practice loop tracks the team's actual weak point as it moves).
Lecture summary
- Conversation intelligence output is a data source to be extracted via API and warehoused, not only browsed in a vendor UI.
- Embeddings place similar meanings near each other in vector space; chunk size trades retrieval precision against context.
- RAG separates retrieval (facts, from a controlled store) from generation (reasoning in language), limiting what the LLM can hallucinate.
- Grounded extraction uses schema constraints, explicit "don't invent" instructions, and mandatory human audit of the output.
- Battlecards and coaching loops convert retrieved evidence into forward-looking action; deliberate-practice design (specific weakness, immediate feedback, adjustment) makes the coaching loop actually improve performance rather than just repeat it.
Review and discussion questions
- Why does
resp.raise_for_status()matter ingong_pull.py? What would happen without it if the API key had expired? - Explain why a question and the chunks it is compared against must be embedded with the same model.
- Derive, in words, why ordering by ascending cosine distance is equivalent to ordering by descending cosine similarity.
- Give an example of a chunk that would be retrieved for a query sharing no words with it, and explain why.
- Identify the two specific prompt-design techniques in Lab 8.4 that reduce hallucination risk, and explain the mechanism by which each works.
- Using Ericsson and Pool's three conditions for deliberate practice, critique a sales-training programme consisting only of a monthly generic roleplay session.
Further reading
- P. Lewis et al., "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks", NeurIPS (2020).
- T. Landauer and S. Dumais, "A Solution to Plato's Problem: The Latent Semantic Analysis Theory", Psychological Review (1997).
- T. Mikolov et al., "Efficient Estimation of Word Representations in Vector Space" (2013).
- K. Anders Ericsson and Robert Pool, Peak: Secrets from the New Science of Expertise (2016).
- pgvector documentation, "Querying" (distance operators and indexing).
In one sentence
Pull call transcripts from tools like Gong, cut them into small pieces, store them so you can search by meaning, then use an LLM to summarise, answer questions and build training material.
The big idea
Sales teams record every call. That is a gold mine nobody reads. Inside are the exact objections buyers raise, how top reps answer them, which competitor comes up, and why deals are lost.
With vector search, a manager can type "how do buyers react when we mention price?" and get the 10 most relevant call moments in seconds, even if no one said the word "price".
Words you must know
- Conversation intelligence
- Software that records, transcribes and analyses sales calls (Gong, Chorus).
- Transcript
- The text of a call, split by speaker and time.
- Chunking
- Cutting long text into small pieces (for example 200–400 words) before storing.
- Embedding
- A list of numbers that represents a text's meaning. Similar meanings get similar numbers.
- Vector search
- Finding the stored chunks whose embeddings are closest to your question's embedding.
- RAG
- Retrieval-augmented generation: search first, then give the found chunks to the LLM to answer from.
- Battlecard
- A one-page guide for beating a specific competitor: their claims, our answers, traps to set.
- Reinforcement loop
- Training repeated over time (quiz, practice, feedback) so skills stick.
How it works, step by step
Practical labs
Pull transcripts from the Gong API
No Gong access? Skip to Lab 8.2. The transcripts.json file from Lab S.4 has 6 mock sales calls in exactly the shape this lab produces.
- Ask a Gong technical admin at the company to create an access key and secret (Gong: Company settings → API). Note the base URL shown on that page.
- Save them in the terminal:
export GONG_ACCESS_KEY="..."andexport GONG_SECRET="..." - In VS Code, create
gong_pull.pyingtm-labs. Paste this, change the dates to a recent month, and save:
import os, json, requests
BASE = "https://api.gong.io" # use the base URL from your Gong API page
AUTH = (os.environ["GONG_ACCESS_KEY"], os.environ["GONG_SECRET"])
resp = requests.post(f"{BASE}/v2/calls/transcript", auth=AUTH, json={
"filter": {
"fromDateTime": "2026-10-01T00:00:00Z",
"toDateTime": "2026-10-31T23:59:59Z"
}
}, timeout=60)
resp.raise_for_status()
data = resp.json()
rows = []
for call in data["callTranscripts"]:
for mono in call["transcript"]: # one "monologue" per speaker turn
text = " ".join(s["text"] for s in mono["sentences"])
rows.append({"call_id": call["callId"], "speaker_id": mono["speakerId"], "text": text})
json.dump(rows, open("transcripts.json", "w"), indent=2)
print(len(rows), "speaker turns saved")
# If data has a "records" -> "cursor" value, call again with that cursor for the next page.
- Run it:
python gong_pull.py
What you should see: "N speaker turns saved" and a transcripts.json file in your folder (this replaces the practice one).
Store transcript chunks in a vector database
- Database. Use your Supabase project from Lab 6.3 (or create one at
supabase.com). Open SQL Editor → New query, paste this and click Run:
create extension if not exists vector;
create table call_chunks (
id bigserial primary key,
call_id text not null,
speaker_id text,
text text not null,
embedding vector(1536) -- must match your embedding model's size
);
- Connection string. In Supabase, click Connect (top of the project page). Under connection string, choose Session pooler and copy the URI. Replace
[YOUR-PASSWORD]in it with your database password. - OpenAI key. At
platform.openai.com, add a small amount of billing credit, then go to API keys → Create new secret key and copy it. - In the terminal, install the libraries and set both secrets:
cd ~/gtm-labs
python -m pip install "psycopg[binary]" openai
export OPENAI_API_KEY="sk-..."
export SUPABASE_DB_URL="postgresql://postgres.xxxx:YOUR-PASSWORD@aws-0-xx.pooler.supabase.com:5432/postgres"
- In VS Code, create
embed_calls.py, paste this and save. It cuts transcripts into chunks of about 250 words, turns each into numbers (an embedding) and stores them:
import json, os, psycopg
from openai import OpenAI
client = OpenAI() # reads OPENAI_API_KEY automatically
rows = json.load(open("transcripts.json"))
def chunks(rows, max_words=250):
buf, call = [], None
for r in rows:
if call and r["call_id"] != call and buf:
yield call, " ".join(buf); buf = []
call = r["call_id"]
buf.append(f'{r["speaker_id"]}: {r["text"]}')
if sum(len(t.split()) for t in buf) >= max_words:
yield call, " ".join(buf); buf = []
if buf: yield call, " ".join(buf)
count = 0
with psycopg.connect(os.environ["SUPABASE_DB_URL"]) as conn:
for call_id, text in chunks(rows):
vec = client.embeddings.create(model="text-embedding-3-small", input=text).data[0].embedding
conn.execute(
"insert into call_chunks (call_id, text, embedding) values (%s, %s, %s::vector)",
(call_id, text, str(vec)))
count += 1
print("stored", count, "chunks")
- Run it:
python embed_calls.py
What you should see: stored N chunks. In Supabase, open Table Editor → call_chunks: each row has the text and a long list of numbers in embedding. Run the script only once, or you will store duplicates (delete them with truncate call_chunks; in the SQL Editor).
Search your calls by meaning
- In VS Code, create
search_calls.py, paste this and save:
import os, sys, psycopg
from openai import OpenAI
client = OpenAI()
question = sys.argv[1] if len(sys.argv) > 1 else "What do buyers say when they think we are too expensive?"
qvec = str(client.embeddings.create(model="text-embedding-3-small", input=question).data[0].embedding)
with psycopg.connect(os.environ["SUPABASE_DB_URL"]) as conn:
hits = conn.execute("""
select call_id, left(text, 300), 1 - (embedding <=> %s::vector) as similarity
from call_chunks
order by embedding <=> %s::vector
limit 5""", (qvec, qvec)).fetchall()
print("Q:", question, "\n")
for call_id, text, sim in hits:
print(f"{sim:.3f} {call_id} {text}\n")
- Run it (in a window where both secrets from Lab 8.2 are set):
python search_calls.py - Ask your own questions in quotes:
python search_calls.py "Which competitor comes up and why?"andpython search_calls.py "security concerns"
What you should see: the 5 closest call moments with a similarity score. For the price question, you get chunks about budget and "steep" pricing even where the word "expensive" never appears. <=> is pgvector's cosine distance; smaller distance means closer meaning.
Summarise every call into the CRM
- Open
transcripts.jsonin VS Code. Copy all the turns for one call (for example every line with"call_id": "call_101"). - Copy the prompt below, paste the turns where it says
{{transcript}}, and send it to Claude.ai. - Check the result against the transcript: every pain, objection and next step must really be in the call. Mark anything invented.
- Repeat for a second call. Compare: which objections show up in both?
You are a sales operations assistant. Read the transcript and return JSON only:
{
"summary": "3 sentences max, plain English",
"pains": ["buyer's problems, in their words"],
"objections": [{"objection": "...", "rep_response": "...", "handled_well": true}],
"competitors_mentioned": ["..."],
"next_steps": [{"owner": "buyer|rep", "task": "...", "due": "date or null"}],
"meddpicc_gaps": ["which of Metrics, Economic buyer, Decision criteria, Decision process,
Paper process, Identify pain, Champion, Competition are still unknown"]
}
Use only what is said in the transcript. If something is not said, leave it out.
Transcript:
{{transcript}}
What you should see: clean JSON naming RivalCo as a competitor, price as an objection, and gaps like "Economic buyer unknown". In a real build, a Zapier or Python step writes these fields into the CRM deal after every call, so reps stop typing notes.
Auto-generate a battlecard
- Find every call moment about the competitor. In the practice data it is called RivalCo:
python search_calls.py "RivalCo is cheaper, we already use RivalCo" - In
search_calls.py, changelimit 5tolimit 20andleft(text, 300)totext, then run again to get 20 full chunks. - Copy the output into Claude.ai together with this prompt (replace
{{competitor}}with RivalCo):
From these call excerpts about {{competitor}}, build a battlecard. Use only the excerpts.
Sections:
1. Why buyers consider {{competitor}} (top 3, with how often each came up)
2. Their claims we hear most, and the best answer our reps gave (quote the call_id)
3. Landmines: 3 questions our reps can ask that expose {{competitor}}'s weak spots
4. When we lose to them, and why
5. Proof points to share
Mark anything mentioned only once as "single mention".
- Paste the battlecard into a Google Doc. Check that every claim has a call_id behind it.
- Write in your notes how you would schedule it weekly (for example a scheduled script that posts the new card to a Slack channel and highlights what changed).
What you should see: a one-page card showing price and an existing RivalCo integration as the main reasons buyers hesitate, and the rep answers that worked best.
Build a training reinforcement loop
- From your Lab 8.4 summaries, list the 3 most common objections (for example price, RivalCo, security).
- Ask Claude.ai: "For each objection below, write a short buyer scenario and the best model answer, using only these real rep answers: [paste the rep_response fields]."
- Open
forms.google.comand create a form with 3 Paragraph questions, one per scenario. Ask a friend or study partner to answer as a sales rep. - Paste each answer and the model answer into Claude.ai: "Score this answer 1–5 against the model answer for accuracy, empathy and a clear next step. Explain in one line."
- In a Google Sheet, track: date, rep, objection, score. Repeat next week with the objections that scored lowest.
What you should see: a sheet where scores per objection rise over the weeks. The final check is real calls: does "handled_well" go up for those objections in Lab 8.4 summaries?
Common mistakes
- Sending whole one-hour transcripts to an LLM and hoping. Chunk and retrieve first.
- Summaries that invent next steps no one said. Force "only what is said".
- Building a search tool nobody opens. Push answers into Slack and the CRM where reps already are.
- Fetching the same transcripts again and again and hitting rate limits.
Proof of work
"Ask our calls" demo
- A repo with ingest, chunk/embed and search scripts, using mock transcripts.
- A Loom: ask 3 questions and show the results with call IDs.
- One generated battlecard as a PDF or web page.
Check yourself
Stage checklist
Stage 09 · Keep & grow customers
Predictive Churn & Net Revenue Retention
Spot customers who are about to leave while there is still time to save them, and spot customers who are ready to spend more.
Learning outcomes
By the end of this lecture you should be able to:
- Explain why net revenue retention compounds growth, and calculate NRR and GRR correctly on a fixed cohort.
- Design a weighted composite health score, read the SQL that computes one line by line, and explain how weights should be validated rather than guessed.
- Explain anomaly detection by rolling-average comparison and read the SQL behind a usage drop-off alert.
- Connect expansion-signal detection to the land-and-expand motion introduced in Lecture A.
- Explain logistic regression as a model for churn probability, including the sigmoid function, and interpret AUC and feature coefficients correctly.
- Identify the main limitations of a renewal risk model built on historical, synthetic, or imbalanced data.
Prerequisites: Lectures A (unit economics), B (relational model, window functions) and 6 (dashboard and cohort methods). Reading time: about 55 minutes, plus 10 hours of labs.
Lecture notes
Lecture 9: Predictive Churn and Net Revenue Retention
9.1 Why retention compounds growth
New-customer acquisition and retained-customer growth interact multiplicatively, not additively. A company acquiring new customers worth 20% of starting revenue each year while losing 10% to churn and gaining 5% from expansion ends the year not at 115% of where it started (20 − 10 + 5), naively summed, but compounds that net change year over year: a company with NRR consistently above 100% grows its existing base every year even before a single new customer is won, while a company below 100% NRR must replace lost revenue before any growth shows at all. This compounding property is why investors and public-market analysts treat NRR as one of the single most informative SaaS metrics, and why Bessemer Venture Partners' annual State of the Cloud report tracks it as a primary benchmark across the public cloud software index.
9.2 NRR and GRR: definitions and the cohort rule
Net revenue retention and gross revenue retention are both measured over a fixed cohort: the set of customers present at the start of the period. The formulas are:
The defining rule, and the most common real-world error, is that revenue from customers won during the period is excluded from both numerator and denominator. Including new customers would let any company with a healthy sales motion inflate its apparent retention — the metric would then measure growth, which is already measured elsewhere, instead of measuring whether the existing base is healthy, which is the entire point of calculating it separately. GRR can never exceed 100% by construction (it only subtracts); NRR can exceed 100% because expansion is added back. The gap between GRR and NRR is, by itself, a direct measurement of how much of the business's growth comes from expanding existing customers versus how much churn is being offset.
9.3 Composite health scores as an early-warning system
A health score compresses several leading indicators into one number so that an account can be triaged without a human reviewing every underlying metric. The weighted-sum design in Lab 9.1 is methodologically identical to a clinical early-warning score: the UK's National Early Warning Score (NEWS2), used throughout the NHS, combines respiratory rate, oxygen saturation, blood pressure, pulse, and consciousness into a single number, with an escalation action triggered once the number crosses a defined threshold — precisely the "Healthy / Watch / At risk" bucketing in the lab. The parallel is not merely illustrative: both designs solve the same underlying problem, which is that no single vital sign (or product signal) is reliable alone, but a disciplined weighted combination catches deterioration earlier and more consistently than any one indicator watched in isolation.
- with s as (...)
- A common table expression (CTE, Lecture B.4) that computes each account's five raw sub-scores in one place before the final weighting, keeping the arithmetic readable and the joins separate from the scoring logic.
- coalesce(greatest(0, least(100, 50 + (events_30d − events_prev_30d) / nullif(events_prev_30d,0) * 100 * 2.5)), 50)
- Converts a percentage change in usage into a 0–100 sub-score centred on 50 (no change). Reading inside-out:
(events_30d − events_prev_30d) / events_prev_30dis the month-over-month percentage change; multiplying by 2.5 scales a 20% change into a 50-point swing (chosen so a ±20% change moves the score to the 0 or 100 boundary); adding 50 recentres it;greatest/leastclamp the result to the valid 0–100 range so an extreme outlier month cannot produce a nonsensical sub-score;nullif(events_prev_30d, 0)turns a division by zero into a SQL NULL instead of an error (Lecture B.4); the outercoalesce(..., 50)catches that NULL (and the NULL that results from no prior-period history at all) and assigns a neutral 50 rather than silently dropping the account from the result. - least(100, features_used_30d / 6 * 100)
- A simple linear scaling: using all 6 tracked features in a month scores 100; using 3 scores 50.
least(100, ...)caps the score at 100 in case a feature list later grows past 6 without the formula being updated. - greatest(0, 100 − open_tickets * 15 − p1_tickets_90d * 25)
- A penalty-based score starting from a perfect 100: each open ticket costs 15 points, each severity-1 ticket in the last 90 days costs a heavier 25 points, and the score floors at 0 rather than going negative.
- if(champion_active_30d, 100, 20)
- A binary signal turned into a score: an active champion scores 100, no active champion scores a low but non-zero 20 (not 0, because losing a champion is a serious risk signal but not automatically equivalent to total account failure).
- 0.35 * usage_score + 0.20 * breadth_score + 0.15 * support_score + 0.15 * champion_score + 0.15 * billing_score
- The weighted sum itself. The weights (35/20/15/15/15, summing to 100) encode a judgement that usage trend is the single strongest leading indicator; §9.3's discussion of validating rather than guessing weights applies directly here — these specific numbers should be treated as a starting hypothesis to test against historical churn, not received wisdom.
- case when raw_score >= 70 then 'Healthy' when raw_score >= 40 then 'Watch' else 'At risk' end
- Converts the continuous score into the three discrete triage buckets a CSM team can actually act on — the same discretisation principle as a NEWS2 escalation threshold.
Crucially, weights chosen by intuition are a hypothesis, not a finding. The methodologically correct validation is exactly what Lab 9.4 later performs with logistic regression: fit a model that estimates each signal's actual statistical relationship to historical churn, and compare its implied weights to the hand-chosen ones. Where they diverge substantially, the hand-chosen weights should be revised.
9.4 Anomaly detection by rolling-average comparison
Lab 9.2's drop-off alert is a simple but general statistical process control technique, tracing back to Walter Shewhart's control charts (1931): establish what "normal" looks like from recent historical data, then flag any new observation that deviates from that baseline by more than a defined threshold. The query computes a 7-day rolling count against a 4-week prior average (itself computed as a rolling window, Lecture 7.6) and flags any account whose ratio falls below 0.6 — a 40%-or-greater drop.
- countif(event_at >= timestamp_sub(current_timestamp(), interval 7 day))
countifis a conditional count: it counts rows matching the condition without needing a separatecase whenwrapped insum. This produces the "last 7 days" activity count per account.- countif(event_at < ... 7 day and event_at >= ... 35 day) / 4
- Counts events in the 28-day window before the last 7 days (day 8 through day 35 back), then divides by 4 to convert a 28-day total into an average per week — making it directly comparable to the 7-day figure above, which is also a one-week count.
- where avg_prior_week >= 10
- A floor that excludes very small accounts from the alert: an account that normally generates 2 events a week dropping to 0 is a 100% change that is statistically meaningless noise, not a real signal, so accounts below this floor are filtered out before the drop-percentage threshold is even evaluated.
- and last_7d < avg_prior_week * 0.6
- The actual alert condition: current week is below 60% of the historical weekly average, i.e. a drop of 40% or more — the threshold chosen in the lab, analogous to choosing how many standard deviations define an "out of control" point on a Shewhart chart.
9.5 Expansion signals and land-and-expand
Lecture A.5 introduced land-and-expand as a GTM motion defined by low-friction initial adoption followed by systematic account growth. Lab 9.3's five expansion signals are the operational instrumentation of that motion's second half: each signal is a leading indicator that a specific expansion play (a seat pack, a tier upgrade, a new-team introduction) is likely to land, detected automatically from product usage rather than discovered only when a renewal conversation happens to come up. The overlap analysis in step 3 (accounts appearing in both the seat-utilisation list and the plan-limit list) is a basic but effective prioritisation heuristic: an account showing two independent expansion signals simultaneously is statistically more likely to convert on an expansion offer than an account showing only one, for the same reason that a health score combining five signals is more reliable than any single signal (§9.3).
9.6 Predictive churn modelling with logistic regression
Where a composite health score encodes a human hypothesis about which signals matter and by how much, a statistical model estimates that relationship directly from historical outcomes. Logistic regression is the standard starting model for a binary outcome (churned / renewed) because it is simple, fast to train, and — critically for a GTM context where a CS leader must trust and act on the output — its coefficients are directly interpretable.
Logistic regression models the log-odds of the outcome as a linear combination of the features: log(p / (1 − p)) = β₀ + β₁x₁ + ... + βₙxₙ, where p is the probability of churn. Solving for p gives the sigmoid function, p = 1 / (1 + e^(−z)), which maps any real-valued linear combination z onto a valid probability between 0 and 1 — this is precisely why logistic regression, unlike plain linear regression, can never predict a probability below 0% or above 100%. The model's coefficients (β) are estimated by maximum likelihood: the fitting procedure chooses the coefficients that make the historically observed outcomes most probable under the model, standard treatments of which can be found in any applied statistics text (e.g. Hosmer and Lemeshow, Applied Logistic Regression; or James, Witten, Hastie and Tibshirani's An Introduction to Statistical Learning).
- df = pd.read_csv("renewals_history.csv")
- Loads the historical training data: one row per past renewal event, with the six feature columns and the known
churnedoutcome (1 = did not renew), already observed — this is supervised learning: the model learns from examples where the right answer is already known. - X_train, X_test, y_train, y_test = train_test_split(..., test_size=0.25, random_state=42, stratify=df["churned"])
- Splits the data so the model is evaluated on rows it never saw during training — without this, a model's reported accuracy would be inflated by memorising the training data rather than genuinely generalising.
stratify=df["churned"]ensures both the train and test sets preserve the same churn/renewal ratio as the full dataset; without stratification, an unlucky random split could put almost all the churned examples into one side, making the model impossible to evaluate fairly.random_state=42fixes the random split so the result is reproducible on a re-run. - model = LogisticRegression(max_iter=1000).fit(X_train, y_train)
fitruns the maximum-likelihood optimisation described above, searching for the coefficient values that best explain the training outcomes.max_iter=1000raises the iteration limit of the underlying numerical solver above its default, because the optimisation is iterative (it improves its estimate step by step) and some feature scales can need more steps to converge.- roc_auc_score(y_test, model.predict_proba(X_test)[:, 1])
predict_probareturns, for each test-set account, the model's estimated probability of each class;[:, 1]selects the probability of the positive class (churned = 1). AUC (area under the ROC curve) measures how well the model's probabilities rank churned accounts above renewed ones across every possible decision threshold simultaneously, rather than at one arbitrary cutoff — this is why AUC, not plain accuracy, is the standard metric for a model whose output will be used to rank accounts by risk (as this one is, in the next step) rather than to make a single yes/no call.- pd.Series(model.coef_[0], index=features).sort_values()
- Reads the fitted coefficients (β values from the formula above) back out of the model, one per feature. A positive coefficient means that feature's log-odds of churn rise as the feature rises (e.g. more overdue invoices → higher churn risk); a negative coefficient means the opposite (e.g. an active champion → lower churn risk). Sorting makes the most protective and most dangerous signals easy to read off directly.
- upcoming["churn_risk"] = model.predict_proba(upcoming[features])[:, 1].round(2)
- Applies the already-trained model to a new set of accounts whose outcome is not yet known (they have not renewed or churned yet) — this is inference, the actual production use of the model, as distinct from the training and evaluation steps above it.
9.7 Limitations and governance of a renewal risk model
Three limitations deserve explicit statement to any CS leader consuming model output, because each can produce confidently wrong action if ignored. First, class imbalance: if churn is rare (say 8% of accounts), a model that simply predicted "never churns" would already be 92% accurate while being completely useless — this is exactly why AUC, which is insensitive to class balance, is reported instead of accuracy. Second, correlation versus causation (Lecture 5.5 revisited): a negative coefficient on champion activity shows association, not proof that artificially forcing champion engagement would reduce churn — the true causal driver might be a healthier relationship generally, of which champion activity is only a visible symptom. Third, and specific to this course, the practice dataset is synthetic; a model's coefficients and AUC on synthetic data demonstrate that the code works, not that the signals chosen are the right ones for a real business — re-validating feature choice against real historical data is mandatory before any production use.
Lecture summary
- NRR/GRR must be measured on a fixed starting cohort, excluding revenue from newly won customers; NRR compounds growth because it applies every year without new acquisition spend.
- Composite health scores combine several leading indicators, following the same logic as a clinical early-warning score; hand-chosen weights are a hypothesis to be validated, not a finished answer.
- Anomaly-based alerting compares a recent window against a historical baseline, in the spirit of Shewhart's statistical process control.
- Logistic regression estimates churn probability via the sigmoid function and log-odds; coefficients are interpretable, AUC measures ranking quality independent of class balance.
- Model output must be read with its limitations in view: class imbalance, correlation vs causation, and (in this course) synthetic training data.
Review and discussion questions
- A company starts the year with $500,000 MRR among its existing cohort, gains $60,000 in expansion, loses $15,000 to contraction and $25,000 to churn, and also wins $80,000 in brand-new customers. Calculate NRR. Explain why the $80,000 is excluded.
- Walk through the usage-score formula in Lab 9.1 line by line and explain what each clamp (
greatest/least) is protecting against. - Why does the drop-off query in Lab 9.2 require
avg_prior_week >= 10before applying the 40% threshold? - Explain why
stratify=df["churned"]matters in the train/test split, using a concrete example of what could go wrong without it. - A churn model reports AUC = 0.95 on training data but AUC = 0.60 on the held-out test set. What does this gap suggest, and which part of the code in §9.6 exists specifically to detect it?
- Using the case study in §9.7, explain the difference between a model being statistically correct and an action based on it being correct.
Further reading
- Bessemer Venture Partners, State of the Cloud (annual report, NRR benchmarking methodology).
- Royal College of Physicians, "National Early Warning Score (NEWS) 2" (2017).
- W. A. Shewhart, Economic Control of Quality of Manufactured Product (1931).
- D. W. Hosmer and S. Lemeshow, Applied Logistic Regression.
- G. James, D. Witten, T. Hastie and R. Tibshirani, An Introduction to Statistical Learning.
In one sentence
Combine usage, support, relationship and billing data into a health score, alert someone when it drops, and track NRR to prove the customer base is growing on its own.
The big idea
Winning a new customer costs a lot. Keeping one costs much less. And a customer who grows their spend is the cheapest revenue of all. That is why investors watch NRR (net revenue retention) so closely: it shows whether your existing customers are growing or shrinking.
Churn rarely happens suddenly. Usage drops, the champion leaves, support tickets pile up, invoices are paid late. Each is a warning light. Your job is to wire those lights to a dashboard and an alarm.
Words you must know
- Churn
- A customer cancels (logo churn) or revenue is lost (revenue churn).
- Contraction
- A customer stays but pays less, such as fewer seats.
- Expansion
- A customer pays more: upgrades, more seats, more usage, add-ons.
- NRR
- Net Revenue Retention: revenue from a fixed group of customers now, compared with a year ago, including expansion.
- GRR
- Gross Revenue Retention: the same, but ignoring expansion. It can never exceed 100%.
- Health score
- A 0–100 number combining signals about how well an account is doing.
- Leading indicator
- A signal that moves before churn (usage drop), not after (cancellation).
- Renewal risk model
- A statistical model that estimates the chance an account will not renew.
The NRR math
Use the same group of customers at the start and end. New customers won during the period do not count. That is the most common NRR mistake.
Try it · NRR and GRR calculator
One cohort, one year
Try it · Customer health score
Weighted health score (0–100)
Practical labs
Build a health score in SQL
- Look at the four input tables first. Run
select * from gtm_lab.usage_rollup limit 10, then do the same forticket_rollup,contact_rollupandbilling_rollup. Each holds one kind of signal per account. - Run the health score. Each signal becomes a 0–100 sub-score, then they are weighted and added (weights match the calculator above):
with s as (
select a.account_id,
-- usage trend: this month vs last month (100 = up 20%+, 0 = down 20%+, 50 = no history)
coalesce(greatest(0, least(100, 50 + (u.events_30d - u.events_prev_30d)
/ nullif(u.events_prev_30d, 0) * 100 * 2.5)), 50) as usage_score,
least(100, u.features_used_30d / 6 * 100) as breadth_score,
greatest(0, 100 - t.open_tickets * 15 - t.p1_tickets_90d * 25) as support_score,
if(c.champion_active_30d, 100, 20) as champion_score,
if(b.invoices_overdue > 0, 20, 100) as billing_score
from gtm_lab.accounts a
join gtm_lab.usage_rollup u using (account_id)
join gtm_lab.ticket_rollup t using (account_id)
join gtm_lab.contact_rollup c using (account_id)
join gtm_lab.billing_rollup b using (account_id)
),
scored as (
select *,
0.35 * usage_score + 0.20 * breadth_score + 0.15 * support_score
+ 0.15 * champion_score + 0.15 * billing_score as raw_score
from s
)
select account_id, round(raw_score) as health_score,
case when raw_score >= 70 then 'Healthy' when raw_score >= 40 then 'Watch' else 'At risk' end as health_label,
round(usage_score) as usage, round(support_score) as support, champion_score, billing_score
from scored
order by health_score;
- Look at the top rows (lowest scores). For each "At risk" account, find which sub-score is lowest; that is where the CSM should start.
- Count the labels: add
select health_label, count(*) from (…your query…) group by 1, or sort the results by the label column. - Change one weight (for example usage 0.35 → 0.50, champion 0.15 → 0.00) and see which accounts change label.
What you should see: one score and label per account, with a mix of Healthy, Watch and At risk. To use it for real, sync health_score and health_label to the CRM with reverse ETL (Lab 1.4).
Usage drop-off alert
- Run this query. It compares each account's last 7 days with its average week over the 4 weeks before, and keeps accounts that dropped 40% or more:
with w as (
select account_id,
countif(event_at >= timestamp_sub(current_timestamp(), interval 7 day)) as last_7d,
countif(event_at < timestamp_sub(current_timestamp(), interval 7 day)
and event_at >= timestamp_sub(current_timestamp(), interval 35 day)) / 4 as avg_prior_week
from gtm_lab.events group by account_id
)
select account_id, last_7d, round(avg_prior_week) as avg_prior_week,
round((last_7d - avg_prior_week) / nullif(avg_prior_week, 0) * 100) as change_pct
from w
where avg_prior_week >= 10 -- ignore tiny accounts
and last_7d < avg_prior_week * 0.6 -- dropped 40%+
order by change_pct;
- Pick the first account in the results. Write the Slack alert a CSM would want, and send it with your Lab 2.2 webhook (replace the URL and numbers):
curl -X POST "https://hooks.slack.com/services/XXX/YYY/ZZZ" -H "Content-Type: application/json" \
-d '{"text":"Usage drop: acct_7 is down 100% this week (0 events vs 25 a week before). Suggested action: check in with the champion today."}'
- To make it automatic: in BigQuery click Schedule above the editor and run the query every morning, saving results to a table. A Make scenario (Lab 2.4) can read new rows and post the alerts.
What you should see: a short list of accounts whose usage fell sharply in the last week (in the practice data, every 7th account stops using the product), and an alert in Slack with the reason and next step.
Track expansion signals
| Expansion signal | How to detect it | Play |
|---|---|---|
| Seats nearly full | active_seats / purchased_seats ≥ 0.85 | Offer a seat pack before they hit the wall |
| Near usage cap | usage this month ≥ 80% of plan | Show the next tier's price per unit |
| New team inside the account | new users with a new department or email sub-group | Intro call with the new team lead |
| Premium feature tried | trial or paywall events on higher-tier features | Time-boxed trial of the higher plan |
| Company growing | headcount up, new funding, hiring (Stage 2 signals) | Account review with the economic buyer |
- Run the seat signal:
select account_id, active_seats, purchased_seats,
round(active_seats / purchased_seats * 100) as seat_utilisation_pct
from gtm_lab.seat_rollup
where active_seats / purchased_seats >= 0.85
order by seat_utilisation_pct desc;
- Run a "premium feature tried" signal: accounts that hit a plan limit 3+ times in the last 30 days:
select account_id, count(*) as limit_hits_30d
from gtm_lab.events
where event_name = 'Plan Limit Reached'
and event_at >= timestamp_sub(current_timestamp(), interval 30 day)
group by account_id
having count(*) >= 3
order by limit_hits_30d desc;
- Find accounts that appear in both lists. Those are your best expansion targets. Write one line per account for the account manager: signal, play, suggested message.
What you should see: a few dozen accounts using 85%+ of their seats, a list of accounts repeatedly hitting limits, and a short overlap list to act on first.
A simple renewal risk model in Python
A logistic regression learns from past renewals which signals mattered, and outputs a probability (0 to 1) of churn for each current account. It is simple, fast, and easy to explain to a CS leader.
- Open
renewals_history.csvin VS Code and look at it: one row per past renewal, six signals, andchurned(1 = did not renew). - Create
churn_model.pyingtm-labs, paste this and save:
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import roc_auc_score
# One row per past renewal. churned = 1 if they did not renew.
df = pd.read_csv("renewals_history.csv")
features = ["usage_change_pct", "features_used", "open_tickets",
"champion_active", "days_since_last_login", "overdue_invoices"]
# Hold back 25% of rows to test the model on data it has not seen
X_train, X_test, y_train, y_test = train_test_split(
df[features], df["churned"], test_size=0.25, random_state=42, stratify=df["churned"])
model = LogisticRegression(max_iter=1000).fit(X_train, y_train)
print("AUC:", round(roc_auc_score(y_test, model.predict_proba(X_test)[:, 1]), 3))
# Which signals push risk up (+) or down (-)?
print(pd.Series(model.coef_[0], index=features).sort_values())
# Score accounts up for renewal in the next 90 days
upcoming = pd.read_csv("upcoming_renewals.csv")
upcoming["churn_risk"] = model.predict_proba(upcoming[features])[:, 1].round(2)
print(upcoming.sort_values("churn_risk", ascending=False).head(10)[["account_id", "churn_risk"]])
- Run it:
python churn_model.py - Read the three outputs: the AUC, the signal weights, and the 10 riskiest upcoming renewals.
- Write a 3-line note for a CS leader: how good the model is, the two signals that matter most, and which 3 accounts to call this week.
What you should see: AUC: 0.888 (0.5 is a coin flip, 0.7+ is useful, 0.8+ is strong). champion_active has the most negative weight (an active champion lowers risk) and overdue_invoices one of the most positive. The top upcoming account shows a churn risk around 0.9. The practice data is synthetic; say so if you share it.
Common mistakes
- Counting new customers inside NRR. Only the starting cohort counts.
- A health score built on opinions nobody checked. Test it: did low scores churn more last year?
- Alerts with no owner or no suggested action.
- Looking only at churn and ignoring expansion. Both move NRR.
Proof of work
Retention early-warning system
- Health score SQL + weight rationale in a repo.
- Drop-off alert screenshot in Slack.
- A one-page NRR report on sample data: NRR, GRR, top 5 risks, top 5 expansion targets, actions.
Check yourself
Stage checklist
Stage 10 · Keep & grow customers
Integration-Led Growth (Ecosystem GTM)
Grow by plugging your product into the tools customers already use, listing in app marketplaces, and selling together with partners.
Learning outcomes
By the end of this lecture you should be able to:
- Explain ecosystem GTM as a growth channel using two-sided-market theory, and distinguish its three mechanisms (discovery, retention, co-selling).
- Describe the OAuth 2.0 authorization code grant precisely, including why the code and the token exchange are separate steps, and read the server code that implements it line by line.
- Explain the CSRF attack the OAuth
stateparameter defends against. - Compare native integrations with iPaaS platforms as a build-vs-buy decision.
- Explain account mapping as a privacy-constrained information-sharing problem between competitors or co-sellers.
- Apply the principle of least privilege to API scope requests and token handling.
Prerequisites: Lecture B (HTTP, APIs, auth schemes) and Lecture A (GTM motions). Reading time: about 55 minutes, plus 10 hours of labs.
Lecture notes
Lecture 10: Integration-Led Growth (Ecosystem GTM)
10.1 Ecosystem GTM and two-sided markets
A platform such as HubSpot or Salesforce is a two-sided market in the sense formalised by Rochet and Tirole, "Platform Competition in Two-Sided Markets" (2003): its value to one side (end users choosing a CRM) depends on the size and quality of the other side (the ecosystem of apps available for it), and vice versa. An app that lists in such a marketplace is not merely advertising; it is participating in a feedback loop in which being present makes the platform more valuable to users, which attracts more users, which makes the listing more valuable. This is the structural reason integrations function as a genuine growth channel rather than a feature line item.
Ecosystem GTM operates through three distinct mechanisms, each with a different metric: marketplace discovery (new customers found through a listing — measured by listing views, installs, and marketplace-sourced pipeline), integration-driven retention (existing customers who are harder to displace because the product is wired into their workflow — measured by the correlation between number of active integrations and churn rate, introduced conceptually in Lecture 9 as an expansion/retention signal), and co-selling (partner-sourced or partner-influenced pipeline — measured in §10.5). Treating these as one undifferentiated "partnerships" line obscures which mechanism is actually producing results.
10.2 The OAuth 2.0 authorization code grant
OAuth 2.0 is formally specified in RFC 6749 (Hardt, 2012). Its core design goal is delegated, scoped access without password sharing: a user grants a third-party application permission to act on their behalf within a bounded set of permissions (scopes), without ever handing that application their actual login credentials. The authorization code grant — the flow used for any application with a server component, including Lab 10.2's integration — proceeds in five steps, each existing to close a specific security gap in the step before it:
- Authorization request. The application redirects the user's browser to the platform's own login page, carrying the application's client ID, the requested scopes, and a redirect URI. The user authenticates directly with the platform, never with the third-party application — this is the entire point of the protocol.
- User consent. The platform shows the user exactly which scopes are being requested and asks them to approve or deny.
- Authorization code issued. On approval, the platform redirects back to the application's redirect URI with a short-lived, single-use authorization code — not a usable access token yet. Issuing a code instead of a token directly at this step matters because the browser redirect is visible in browser history and referrer headers; a code that is useless without the client secret is safe to expose this way, whereas a live access token would not be.
- Token exchange. The application's own server (never the browser) sends the authorization code, together with its client ID and client secret, directly to the platform's token endpoint over a server-to-server HTTPS request. This step must happen server-side specifically because it is the only step in the flow that requires the client secret, and the client secret must never reach the browser or any client-side code, where it would be visible to the user or to any script on the page.
- API calls with the access token. The application now holds an access token (used, short-lived) and typically a refresh token (used to obtain new access tokens without repeating user consent, until the user revokes access).
- const { CLIENT_ID, CLIENT_SECRET } = process.env;
- Destructures both secrets out of environment variables (Lecture B.2's "secrets live in the environment, never in source" pattern, now in Node.js).
CLIENT_SECRETis read here but, notice, is used only inside the server-side/oauth/callbackhandler below — never sent to the browser. - app.get('/install', (req, res) => { pendingState = randomBytes(16).toString('hex'); ... })
- Implements step 1.
randomBytes(16)generates 16 bytes of cryptographically secure randomness and.toString('hex')renders them as a 32-character string. This becomes the OAuthstateparameter, explained in §10.3. - url.searchParams.set('scope', 'crm.objects.contacts.read')
- Requests exactly one narrow, read-only scope — the principle of least privilege (§10.6) encoded directly in the authorization request.
- res.redirect(url.toString())
- Sends the user's browser to HubSpot's own consent page — step 1 completed. Note that at no point up to here has the application seen or needed any HubSpot credential belonging to the user.
- app.get('/oauth/callback', async (req, res) => { if (req.query.state !== pendingState) return res.status(400).send('State mismatch'); ...
- This is the redirect target for step 3. The very first line checks the
statevalue HubSpot echoes back against the one generated in/install— see §10.3 for exactly what attack this line prevents, and why it must run before anything else in this handler. - const tokenRes = await fetch('https://api.hubapi.com/oauth/v1/token', { method: 'POST', ... body: new URLSearchParams({ grant_type: 'authorization_code', client_id, client_secret, redirect_uri, code: req.query.code }) })
- Implements step 4: a server-to-server POST exchanging the one-time code (received as a query parameter on this very request) plus the client secret for real tokens. This
fetchcall runs on the application's own server — the code that executes it is never sent to the user's browser, which is why putting the client secret here (and only here) is safe. - const tokens = await tokenRes.json(); // access_token, refresh_token, expires_in
- Step 4 complete. The comment names the three fields a real implementation must persist (encrypted, per the lab's warning) —
expires_inspecifically is what later code would check before deciding to use the refresh token. - const contacts = await fetch(..., { headers: { Authorization: \`Bearer ${tokens.access_token}\` } })
- Step 5: the access token is sent as a Bearer credential (Lecture B.2's bearer-token auth scheme) in the
Authorizationheader of an ordinary API GET request — proving the whole flow worked by successfully reading real data.
10.3 The state parameter and CSRF protection
Without the state check, the callback endpoint would accept any authorization code sent to it, from anywhere. An attacker can obtain a valid authorization code for their own account (by starting the OAuth flow themselves) and then trick a victim's browser into visiting the application's callback URL with the attacker's code attached — a cross-site request forgery (CSRF), here specifically called authorization code injection. If the application's server blindly exchanged whatever code arrived, it would connect the victim's session to the attacker's HubSpot account, potentially exposing the victim's data to the attacker or vice versa depending on what the flow does next. Generating an unguessable, single-use state value before redirecting, and rejecting any callback whose state does not match, closes this gap: an attacker cannot forge a state value they were never issued.
10.4 Native integrations versus iPaaS: a build-versus-buy decision
A native integration (Lab 10.2's hand-built OAuth connector) and an iPaaS workflow (Lab 10.3's Zapier template) sit at different points on a standard build-versus-buy trade-off. Native integrations cost more engineering time up front but give full control over the data model, performance, and user experience, and they are the only option when the integration is deep enough to be a core product feature (for example, syncing data bidirectionally in real time). iPaaS platforms trade that control for speed: a workflow a GTM engineer can publish in under two hours (Lab 10.3) reaches users immediately and requires no ongoing engineering maintenance, at the cost of being limited to whatever triggers and actions the iPaaS vendor has already built for each app. The correct GTM engineering judgment is not "always build" or "always buy" but matching the mechanism to the ecosystem-GTM goal from §10.1: discovery-oriented, high-volume, shallow workflows are iPaaS territory; retention-critical, deep, high-usage integrations justify a native build.
10.5 Account mapping as constrained information sharing
Co-selling requires two organisations — often competitors for budget, sometimes direct competitors — to compare customer lists to find overlaps, which is inherently in tension with each side's interest in not revealing its full customer list to the other. Platforms such as Crossbeam solve this with a form of privacy-preserving set intersection: each side uploads its account list, the platform computes and reveals only the overlap (and only to the extent both sides have agreed to share), and neither side sees the other's non-overlapping accounts. Lab 10.4's spreadsheet exercise simplifies this for teaching purposes — real account mapping tools implement the actual matching cryptographically or via a trusted third party so that a loss of trust between the two parties does not expose the full account list of either.
- coalesce(partner_name, 'No partner') as partner
- Deals with no partner involvement have a NULL
partner_name;coalescerelabels that NULL as the readable string'No partner'so it groups and sorts sensibly rather than appearing as a blank row. - countif(partner_sourced) as sourced_deals, countif(partner_influenced) as influenced_deals
- Two separate conditional counts implementing the sourced/influenced distinction from the terms list: sourced means the partner brought the deal, influenced means the partner helped a deal that already existed — a deal can be influenced without being sourced, so these are deliberately not mutually exclusive counts.
- round(avg(cycle_days)) as avg_cycle_days
- The average sales-cycle length per partner group. Comparing this figure between "No partner" and named-partner rows is exactly how the lab's headline claim — "partner deals close X days faster" — gets its evidence.
10.6 Scopes and the principle of least privilege
Every OAuth scope requested is a liability as well as a capability: it is data the application can access, data a security reviewer must evaluate, and data exposed if the application is ever compromised. The principle of least privilege — request only the access actually needed for the stated purpose — is both a security best practice and, concretely, a marketplace-approval requirement: HubSpot's, Salesforce's, and similar app-review processes explicitly reject or delay listings that request broad scopes (write access to all CRM objects) to perform a narrow function (reading contact names). Lab 10.2's single scope, crm.objects.contacts.read, demonstrates the pattern deliberately: request exactly what the stated integration does, nothing more, and expand scopes later only alongside a feature that genuinely needs them.
Lecture summary
- Ecosystem GTM works through two-sided-market dynamics: listing in a marketplace is participating in a feedback loop between platform users and the app ecosystem, not simple advertising.
- The OAuth 2.0 authorization code grant separates a browser-safe authorization code from a server-only access token specifically so the client secret never reaches the browser.
- The
stateparameter prevents authorization code injection, a CSRF variant where an attacker's own code is submitted through a victim's browser. - Native integrations and iPaaS workflows are a build-vs-buy decision, matched to whether the integration is discovery-oriented or retention-critical.
- Account mapping requires constrained, overlap-only information sharing between parties who should not see each other's full customer lists.
Review and discussion questions
- Explain why the authorization code in step 3 is safe to expose in a browser redirect while the access token in step 4 is not.
- Walk through what would go wrong, concretely, if the
statecheck inapp.jswere removed. - Why must the token-exchange request in §10.2 happen on the application's server rather than in the user's browser?
- Give an example of an ecosystem-GTM decision where iPaaS is clearly the right mechanism and one where a native integration is clearly required, and justify each.
- Explain, in your own words, what account mapping tools like Crossbeam reveal to each party and what they deliberately do not reveal.
- A marketplace reviewer rejects an app for requesting a scope it does not use. Using §10.6, explain why this rejection is correct policy, not excessive caution.
Further reading
- J.-C. Rochet and J. Tirole, "Platform Competition in Two-Sided Markets", Journal of the European Economic Association (2003).
- D. Hardt (ed.), "The OAuth 2.0 Authorization Framework", RFC 6749, IETF (2012).
- HubSpot Developer Documentation, "OAuth Quickstart" and app marketplace scope-review guidelines.
- Crossbeam documentation, "How Account Mapping Works".
In one sentence
Connect your product to bigger platforms so customers find you inside tools they trust, stay longer because you are wired into their workflow, and get introduced to you by partners.
The big idea
Every company runs on a stack: a CRM, Slack, email, a data warehouse. A product that connects to that stack is easier to buy and harder to remove. Many SaaS companies find that customers who connect one or more integrations churn less, which is why integrations are a growth channel, not just a feature.
Ecosystem GTM has three engines: marketplaces (customers discover you), integrations (customers stay), and co-selling (partners bring you deals).
Words you must know
- App marketplace
- A directory inside a platform where users find add-ons: HubSpot App Marketplace, Salesforce AppExchange, Slack Marketplace, Shopify App Store, Zapier's app directory.
- Native integration
- A connection you build and maintain yourself, using the platform's API.
- OAuth 2.0
- The standard "Log in with X and allow access" flow. The user grants your app limited access without giving you their password.
- Scope
- The specific permissions your app asks for, like "read contacts".
- Access / refresh token
- The access token is a short-lived key to call the API. The refresh token gets a new one when it expires.
- iPaaS
- Integration Platform as a Service: Zapier, Make, n8n, Workato.
- Account mapping
- Comparing your customer list with a partner's to find shared accounts and warm intros (Crossbeam does this).
- Partner-sourced / influenced
- Sourced: the partner brought the deal. Influenced: the partner helped a deal you already had.
How OAuth works, step by step
Practical labs
Map an ecosystem
- Pick a product (your Lab A.1 company works). Open its Integrations page, a few of its job posts, and its G2 page.
- In a Google Sheet, list the 10 tools its customers use most. Add columns: Tool, Customer overlap (1–5), Workflow overlap (1–5), Has marketplace? (1–5), Has partner programme? (1–5), Total.
- Score each tool. In the Total column, type
=SUM(B2:E2)and drag it down. - Sort by Total and pick the top 2.
- For each, write one sentence: "When a user does X in [tool], our product does Y automatically."
What you should see: a ranked list with two clear winners and a one-sentence integration idea for each. These feed Labs 9.2–9.5.
Build a real OAuth flow with HubSpot
- Go to
developers.hubspot.comand create a free developer account. Inside it, create a test account (HubSpot calls it a developer test account); this is a safe sandbox CRM. - Create an app following HubSpot's current app quickstart. Their newer developer platform sets apps up as "projects" with the HubSpot CLI; follow their guide for that part.
- In the app's auth settings, set the redirect URL to
http://localhost:3000/oauth/callbackand add the scopecrm.objects.contacts.read. Copy the client ID and client secret. - Create the project folder:
cd ~/gtm-labs
mkdir hubspot-oauth
cd hubspot-oauth
npm init -y
npm install express
code .
- In VS Code, open
package.json, add"type": "module",under the"name"line, and save. Then createapp.js, paste this and save:
import express from 'express';
import { randomBytes } from 'node:crypto';
const { CLIENT_ID, CLIENT_SECRET } = process.env;
const REDIRECT_URI = 'http://localhost:3000/oauth/callback';
const app = express();
let pendingState = null;
// Step 1: send the user to HubSpot to approve access
app.get('/install', (req, res) => {
pendingState = randomBytes(16).toString('hex'); // protects against forged callbacks
const url = new URL('https://app.hubspot.com/oauth/authorize');
url.searchParams.set('client_id', CLIENT_ID);
url.searchParams.set('redirect_uri', REDIRECT_URI);
url.searchParams.set('scope', 'crm.objects.contacts.read');
url.searchParams.set('state', pendingState);
res.redirect(url.toString());
});
// Steps 3-5: HubSpot sends us back with a code; swap it for tokens; call the API
app.get('/oauth/callback', async (req, res) => {
if (req.query.state !== pendingState) return res.status(400).send('State mismatch');
const tokenRes = await fetch('https://api.hubapi.com/oauth/v1/token', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({
grant_type: 'authorization_code',
client_id: CLIENT_ID,
client_secret: CLIENT_SECRET,
redirect_uri: REDIRECT_URI,
code: req.query.code
})
});
const tokens = await tokenRes.json(); // access_token, refresh_token, expires_in
// In real life: encrypt and store tokens per customer in your database.
const contacts = await fetch('https://api.hubapi.com/crm/v3/objects/contacts?limit=5', {
headers: { Authorization: `Bearer ${tokens.access_token}` }
}).then(r => r.json());
res.json({ connected: true, sample_contacts: contacts.results?.map(c => c.properties) });
});
app.listen(3000, () => console.log('Open http://localhost:3000/install'));
- Set your app's details and start the server:
export CLIENT_ID="paste-client-id"
export CLIENT_SECRET="paste-client-secret"
node app.js
- Open
http://localhost:3000/installin your browser. Choose your test account and click Connect app.
What you should see: HubSpot's consent screen, then a page showing "connected": true and up to 5 contacts from the test account (add a contact in the test account first if the list is empty). You just built the core of every marketplace integration. Stop the server with Ctrl + C.
Publish a Zapier or Make template
- Pick a high-value workflow from Lab 10.1, such as "When a deal closes in HubSpot, create a project in Asana and post in Slack."
- In Zapier, click Create → Zaps. Set the trigger (for example HubSpot: Deal stage changed), then add the action steps. Connect the apps when asked.
- Click Test on each step using real sample data from your free accounts. Fix anything that fails.
- Rename the Zap by the outcome, not the plumbing: "Kick off onboarding automatically when a deal is won."
- Write a 3-line description: who it is for, what it does, what you need connected.
- Share it: in the Zap's menu choose Share and copy the link (in Make: scenario menu → Share).
What you should see: a public link that lets anyone copy the workflow in one click. Templates are a cheap way to show a product fits a customer's stack. If the product has its own Zapier app, templates can also be published in its app directory.
Run co-selling with account mapping
- Open a new Google Sheet. Name the first tab Ours and the second tab Partner.
- In Ours, paste our accounts. In Partner, paste the partner's customers (in real life the partner shares this through Crossbeam, which only reveals overlaps both sides agree to):
domain,status
acme.com,open deal
globex.io,customer
initech.com,target
umbrella.co,open deal
northwind.com,target
bluepeak.io,customer
domain,status
acme.com,customer
northwind.com,customer
bluepeak.io,open deal
summit.dev,customer
- In Ours, cell C1 type
partner_status. In C2 type this formula and drag it down:=IFERROR(VLOOKUP(A2, Partner!A:B, 2, FALSE), "") - Label each overlap with the play from this table:
| Overlap | Meaning | Co-selling play |
|---|---|---|
| Our open deal + their customer | Partner knows this buyer | Ask the partner rep for a warm intro or a reference |
| Our customer + their open deal | We can help them win | Offer an integration demo; earn goodwill |
| Our target + their customer | New pipeline | Joint webinar or joint outreach to these accounts |
- Now measure partner impact in BigQuery. Run this against the practice deals:
select
coalesce(partner_name, 'No partner') as partner,
countif(partner_sourced) as sourced_deals,
countif(partner_influenced) as influenced_deals,
count(*) as won_deals,
sum(amount) as won_revenue,
round(avg(cycle_days)) as avg_cycle_days
from gtm_lab.opportunities
where stage = 'Closed Won'
group by partner
order by won_revenue desc;
What you should see: in the sheet, acme.com (warm intro), bluepeak.io (help them win) and northwind.com (joint outreach). In BigQuery, partner rows close faster than "No partner" (a shorter avg_cycle_days). That is the killer slide: "Partner deals close X days faster."
Marketplace listing checklist
- Open the HubSpot App Marketplace and pick one category (for example Sales → Sales enablement).
- Open the top 3 listings. In a Google Doc, note for each: title, first sentence, number of screenshots, what data syncs, setup time, number of reviews.
- Write your own listing for your Lab 10.1 integration idea, with these five parts:
- A title that names the outcome, not just your brand.
- 3 screenshots of the integration inside the host platform (describe them if you have no product).
- A list of exactly what data syncs, in which direction, and how often.
- Setup steps (aim for under 5 minutes).
- A plan for reviews: ask happy users to review in the first month.
What you should see: a listing that stands next to the top 3 and makes the outcome clear in the first line.
Common mistakes
- Building 20 shallow integrations instead of 2 deep ones that match real workflows.
- Asking for every OAuth scope "just in case". Users and marketplace reviewers reject that.
- Not tracking which accounts use which integration, so you cannot prove the retention effect.
- Treating partners as a lead list. Co-selling needs give-and-take.
Proof of work
Ecosystem plan + working connector
- Your OAuth app repo with a README and a 2-minute demo video.
- A public Zap or Make template link.
- A 1-page ecosystem plan: top 2 platforms, why, the listing copy, and the co-selling play.
Check yourself
Stage checklist
Stage 11 · Keep & grow customers
The Automated QBR
Every quarter, customers ask "was this worth it?". Build a system that answers with their own numbers, in a ready-made deck, without a CSM spending two days in spreadsheets.
Learning outcomes
By the end of this lecture you should be able to:
- Distinguish outcome reporting from activity reporting and explain why a QBR without a captured baseline cannot prove value.
- Apply the four standard ROI value-type formulas and critique an ROI claim for credibility.
- Read the SQL, Python, and YAML behind an automated QBR pipeline line by line, from data extraction through scheduled deployment.
- Explain grounded generation and implement a verification check that catches numeric hallucination programmatically.
- Explain templated document generation as a general pattern and apply it beyond slide decks.
- Explain cron scheduling syntax and the role of CI/CD infrastructure in running recurring business processes.
Prerequisites: Lectures 7 (grounding and hallucination), 8 (leading indicators) and B (relational model, version control). Reading time: about 55 minutes, plus 10 hours of labs.
Lecture notes
Lecture 11: The Automated QBR
11.1 Outcomes versus activity, and the necessity of a baseline
A quarterly business review's purpose is to answer one question credibly: did the customer's situation improve because of this product. Answering it requires three specific numbers for every goal tracked — a baseline (the value before the product was adopted or before the period began), a current value, and a target — and reporting the movement between them. Reporting activity instead (logins, API calls, seats provisioned) substitutes a measurement of engagement for a measurement of outcome; the two are correlated but not identical, and a sophisticated buyer notices the substitution. The baseline specifically cannot be reconstructed after the fact — if it was not captured at the start of the relationship, no later analysis can recover "what it used to be," which is why Lab 11.1's data model treats the success plan's baseline as a first-class, separately-stored field rather than something computed on demand.
11.2 ROI formulas and the credibility constraint
Return on investment is formally ROI = (value gained − cost) ÷ cost, applied to four distinguishable value types, each requiring a different measurement approach:
| Value type | Formula | What makes the number defensible |
|---|---|---|
| Time saved | hours saved × fully-loaded hourly cost | The hourly cost must be the customer's own figure, not an assumed average |
| Revenue gained | extra pipeline or deals × win rate × deal size | Win rate and deal size must be the customer's own historical figures |
| Cost avoided | tools replaced + headcount not hired | Requires the customer to confirm the tool was actually decommissioned or the hire genuinely not made |
| Risk reduced | probability × cost of the bad event | Hardest to defend: both inputs are estimates, so this value type carries the least persuasive weight alone |
The manual's rule — "only count value the customer agrees with, use their hourly cost and win rate, never yours" — is a credibility constraint, not merely a politeness norm: a self-generated ROI number is unfalsifiable by the customer and reads as marketing; a number built from the customer's own previously stated figures is, by construction, a number the customer cannot easily dispute without disputing something they said themselves.
11.3 Extracting quarterly metrics from the warehouse
Lab 11.1's query assembles exactly the baseline/current/target triple described in §11.1 by joining usage events against the stored success plan.
- count(distinct e.user_id) as active_users
distinctmatters here specifically: without it, a user generating 50 events in the quarter would be counted 50 times, wildly inflating the headcount figure. Counting distinct users converts an event-level table into an account-level adoption measure.- countif(e.event_name = 'Task Automated') * 6 / 60 as hours_saved
- Converts a raw count of automation events into a business-meaningful hours figure using a conversion rate (6 minutes per task) that the comment flags as agreed with the customer — exactly the §11.2 credibility rule applied inside the SQL itself, not just in the final slide.
- left join gtm_lab.success_plans sp using (account_id)
- A left join, not an inner join, deliberately: an account with usage data but no recorded success plan should still appear in the results (with NULL goal fields) rather than silently vanishing from the report — a missing success plan is itself a finding ("this account has no baseline captured"), not a reason to hide the account.
- group by a.account_id, a.name, sp.goal_1_name, sp.goal_1_baseline, sp.goal_1_target, m.goal_1_current
- Every non-aggregated column selected must appear in the
group bylist (Lecture B.4); listing the success-plan fields here, even though they are not being aggregated, is required because SQL cannot otherwise know which single value to show per group when multiple rows could theoretically carry different values.
11.4 Programmatic chart generation
Lab 11.2 generates one chart per account by code rather than by hand in a spreadsheet tool — the first instance in this course of templated visual output, a pattern that recurs in §11.6 for whole decks. The design choice to use matplotlib's non-interactive Agg backend is not cosmetic: a server or a scheduled CI job (§11.7) has no display to draw an interactive window on, and attempting to use an interactive backend in that environment raises an error. Agg renders directly to an image file in memory, which is the only backend that works unattended.
- matplotlib.use("Agg")
- Must be called before
import matplotlib.pyplot as plt— matplotlib selects its rendering backend at import time, so setting it afterward has no effect. This single line is what lets the script run unattended on a CI server with no screen, as it eventually will in §11.7. - def usage_chart(account_id, path): d = weekly[weekly.account_id == account_id]
- Filters the full weekly-usage dataframe down to just the rows for one account — the same per-entity filtering pattern used throughout the course's batch-processing scripts (compare the per-call loop in Lab 8.2).
- ax.fill_between(d.week, d.active_users, alpha=0.12, color="#0A6C76")
- Shades the area under the line at low opacity (
alpha=0.12) — a purely visual choice that makes a trend line easier to read at a glance without this being a second, distracting data series. - ax.spines[["top", "right"]].set_visible(False)
- Removes the chart's top and right border lines, a standard decluttering convention (directly following the data-ink minimisation principle Lecture 7.7 introduced via Tufte): every line on a chart should earn its place by carrying information, and a box border around a line chart carries none.
- for acct in accounts: usage_chart(acct, f"usage_{acct}.png")
- The batch loop: the same charting function is called once per account with a different output filename each time — a one-to-many templating pattern that reappears, generalised to whole slide decks, in §11.6.
11.5 Grounded generation and programmatic verification
Lecture 8.5 established that LLM summarisation of sensitive source material should be schema-constrained and explicitly instructed not to invent facts, with human review as a backstop. A QBR summary adds a further requirement beyond what Lecture 8 covered: because the numbers in a QBR are read by an executive who will act on them financially, an automated, code-based check should exist in addition to human review — one that can run on every generated summary before it ever reaches a human reviewer, catching the easy, mechanical failure mode (a number that simply does not appear in the source data) before spending a human's attention on it.
- NUM = r"\d[\d,]*(?:\.\d+)?"
- A regular expression matching a number: one digit, then any run of digits or thousands-separating commas, optionally followed by a decimal point and more digits. The specific shape matters: an earlier, simpler pattern in this course's development incorrectly matched the full stop ending a sentence (treating "...a target of 28." as if "28." were the number, which then failed to match the source data's plain "28") — this corrected pattern's non-capturing group
(?:\.\d+)?only matches a decimal point when it is immediately followed by more digits, so a sentence-ending period after a whole number is correctly excluded. - clean = lambda nums: {n.replace(",", "") for n in nums}
- A small anonymous function, stored in a variable, that strips thousands-separator commas from every matched number and collects the results into a set (an unordered collection with no duplicates) — using a set rather than a list is deliberate, because the question "is this number present in the source" does not care how many times it appears or in what order.
- allowed = clean(re.findall(NUM, json.dumps(metrics)))
- Serialises the entire metrics dictionary back to a JSON string and extracts every number that appears anywhere in it — this is the full universe of numbers the summary is permitted to use.
- used = clean(re.findall(NUM, summary))
- Extracts every number the LLM's summary actually used, cleaned the same way for a fair comparison.
- return used <= allowed
- Python's subset operator on sets: this returns
Trueonly if every number inusedalso appears inallowed— i.e. the summary introduced no number that cannot be traced back to the source data. This is the entire grounding check, expressed as one set-containment comparison.
11.6 Templated document generation
Lab 11.4 generalises §11.4's one-chart-per-account pattern to a full deck: the same slide structure, populated with a different account's data, repeated across every row of a dataframe. This is a modern instance of a much older idea — mail merge, the decades-old technique of combining a fixed template with a list of records to produce one personalised document per record — now implemented over an object model (python-pptx) instead of a word processor's merge fields.
- def bullet_slide(prs, title, lines): s = prs.slides.add_slide(prs.slide_layouts[1])
- python-pptx represents a presentation as a tree of objects: a
Presentationcontainsslides, each built from a numberedslide_layouttemplate defined in the underlying PowerPoint theme. Layout index 1 is "Title and Content" — a reusable function wrapping this means every bullet slide in the deck is constructed identically, rather than repeating the same five lines of object-building code for each one. - tf.text = lines[0]; for line in lines[1:]: tf.add_paragraph().text = line
- A text frame's first line of text is set via its
.textproperty directly; every subsequent bullet must be added as a new paragraph object — this asymmetry is simply how the underlying PowerPoint XML schema represents a text box (the first paragraph already exists by default; later ones must be explicitly created). - for r in rows: prs = Presentation(); ...; prs.save(f"QBR_{r['name'].replace(' ', '_')}.pptx")
- The outer loop: a brand-new, blank
Presentationobject is created fresh for every account row (not reused across iterations — reusing one object would accumulate every account's slides into a single giant deck), populated, and saved to a filename derived from the account's name with spaces replaced by underscores, since spaces in filenames cause problems in many tools and shell commands. - chart.shapes.add_picture(f"usage_{r['account_id']}.png", Inches(0.5), Inches(1.6), width=Inches(9))
- Places the matching PNG chart generated in Lab 11.2 onto a slide at a specified position and width, in inches — this is the integration point between the two scripts:
build_decks.pydepends onqbr_charts.pyhaving already run and produced files with matching filenames, which is exactly why Lab 11.5 concatenates both scripts into one file to guarantee the ordering.
11.7 Scheduled automation with CI/CD infrastructure
Lab 11.5 repurposes GitHub Actions — infrastructure built for continuous integration and deployment of software — to run a recurring business process on a schedule. This is a legitimate and increasingly common use of CI/CD tooling: the underlying need (run this code reliably, on a schedule, on infrastructure that is not somebody's laptop, and keep a log of every run) is identical whether the code being run is a test suite or a QBR deck generator.
- schedule: - cron: "0 6 1 1,4,7,10 *"
- Standard five-field cron syntax (minute, hour, day-of-month, month, day-of-week — the same format used by scheduling tools generally):
0 6means 06:00;1in the day-of-month field means the 1st of the month;1,4,7,10restricts the month field to January, April, July and October — the start of each calendar quarter; the final*means "any day of the week," which is irrelevant here since the day-of-month field already pins it to a specific date. Read together: "run at 06:00 UTC on the 1st of January, April, July, and October." - workflow_dispatch: {}
- Adds a manual trigger button in the GitHub Actions UI, independent of the schedule — essential during development and testing, since waiting for the next quarter to test the workflow would be impractical.
- uses: actions/checkout@v4
- The first step in nearly any GitHub Actions job: checks out the repository's own code onto the temporary virtual machine the job runs on, so subsequent steps have the scripts and CSV files to work with.
- run: pip install pandas matplotlib python-pptx
- Installs the exact three libraries the concatenated script needs — the CI environment starts with nothing pre-installed beyond the base OS and the specified Python version, unlike a developer's own machine where these might already be present.
- uses: actions/upload-artifact@v4 with: { name: qbr-decks, path: "*.pptx" }
- Because each job runs on a fresh, disposable virtual machine that is destroyed after the job finishes, any file the job produced (here, every
.pptxthe script wrote) would be lost unless explicitly uploaded as a named artifact — this step is what makes the generated decks downloadable afterward from the Actions run page.
Lecture summary
- A QBR must report outcomes (baseline → current → target) rather than activity, and a baseline not captured at the outset cannot be reconstructed later.
- ROI figures are credible only when built from the customer's own stated inputs (their hourly cost, their win rate), not the vendor's assumptions.
- Chart and deck generation apply the same templated, batch pattern: one function or layout, applied once per account via a loop.
- Grounded generation should be checked both by instruction (the prompt) and by code (a programmatic verification step), with human review as the final backstop — each layer catches different failures.
- CI/CD infrastructure like GitHub Actions is general-purpose scheduled-execution infrastructure, applicable to recurring business processes as much as to software tests.
Review and discussion questions
- Explain why "hours saved" must use the customer's own hourly cost rather than an industry average to be credible in a QBR.
- Why does Lab 11.1's query use a left join rather than an inner join against the success_plans table? What would an inner join silently hide?
- Explain in your own words why
matplotlib.use("Agg")must be the first matplotlib-related line in a script meant to run unattended. - Walk through why the regex
\d[\d,]*(?:\.\d+)?correctly excludes the period at the end of a sentence like "a target of 28." Give an input where the simpler pattern\d[\d,]*\.?\d*would fail and this one would not. - Using the §11.7 case study, explain why a grounding check passing is not sufficient justification for removing human review.
- Explain the cron expression
0 6 1 1,4,7,10 *in plain English, field by field.
Further reading
- python-pptx documentation, "Working with Text" and "Working with Pictures".
- GitHub Actions documentation, "Events that trigger workflows" (schedule, workflow_dispatch) and "Storing workflow data as artifacts".
- Matplotlib documentation, "What is a backend?".
- Python documentation,
remodule (regular expression syntax) and set operations.
In one sentence
Pull each customer's usage and results from the warehouse, calculate the value they got, write a short summary with an LLM that may only use those numbers, and drop it all into a slide deck automatically.
The big idea
A QBR (Quarterly Business Review) is a meeting where you show a customer the value they received and agree on next quarter's goals. Done well, it protects the renewal and opens expansion. Done badly, it is 40 slides of vanity charts.
Most CSMs spend hours building each deck by hand. When you automate the 80% that is data and formatting, the CSM spends their time on the 20% that matters: the conversation.
Words you must know
- QBR / EBR
- Quarterly / Executive Business Review: a value review with the customer's decision makers.
- Success plan
- The customer's goals written down at the start, with numbers. The QBR measures against it.
- ROI
- Return on investment: (value gained − cost) ÷ cost.
- Payback period
- How many months until the value gained equals what they paid.
- Baseline
- The "before" number. Without it, you cannot prove change.
- Vanity metric
- A number that looks impressive but does not show value (logins, page views).
ROI frameworks that executives accept
| Value type | Formula | Example |
|---|---|---|
| Time saved | hours saved × fully-loaded hourly cost | 120 hrs/month × $45 = $5,400/month |
| Revenue gained | extra pipeline or deals × win rate × deal size | 8 extra meetings → 2 wins × $9,000 |
| Cost avoided | tools replaced + headcount not hired | Replaced a $1,200/month data tool |
| Risk reduced | probability × cost of the bad event | Fewer compliance errors |
Rule: only count value the customer agrees with. Use their hourly cost and their win rate, never yours.
Try it · QBR ROI calculator
What did this customer get for their money?
The QBR deck in 7 slides
- Title: account name, quarter, attendees.
- Goals recap: the 2–3 goals from the success plan, with baseline numbers.
- Results: each goal: baseline → now → target, with a green/amber/red status.
- Value delivered: the ROI number with the formula shown.
- Adoption: one chart of usage trend and which teams use it.
- Risks & asks: what is blocking more value, and what you need from them.
- Next quarter: new goals and a mutual action plan.
Practical labs
Pull quarterly metrics per account
- Run this query. It pulls the last 90 days of usage per account plus each account's goal from its success plan:
select
a.account_id, a.name,
count(distinct e.user_id) as active_users,
countif(e.event_name = 'Report Created') as reports_created,
countif(e.event_name = 'Task Automated') as tasks_automated,
round(countif(e.event_name = 'Task Automated') * 6 / 60) as hours_saved, -- 6 min per task (agreed with customer)
sp.goal_1_name, sp.goal_1_baseline, sp.goal_1_target, m.goal_1_current
from gtm_lab.accounts a
join gtm_lab.events e using (account_id)
left join gtm_lab.success_plans sp using (account_id)
left join gtm_lab.goal_metrics m using (account_id)
where e.event_at >= timestamp_sub(current_timestamp(), interval 90 day)
group by a.account_id, a.name, sp.goal_1_name, sp.goal_1_baseline, sp.goal_1_target, m.goal_1_current
order by tasks_automated desc
limit 5;
- For each of the 5 accounts, compare
goal_1_currentwithgoal_1_target: on track, close, or behind? - For the next labs you can use the matching practice file
qbr_metrics.csvfrom Lab S.4 (it has the same columns). Level up: click Save results → CSV to use your own query results instead, and export weekly usage with this query, saved asweekly_usage.csv:
select account_id, date_trunc(date(event_at), week) as week, count(distinct user_id) as active_users
from gtm_lab.events
where event_at >= timestamp_sub(current_timestamp(), interval 90 day)
group by 1, 2
order by 1, 2;
What you should see: 5 rows, each with users, tasks automated, hours saved and progress on a goal. This is the raw material of every QBR.
Make a clean chart per account
- Create
qbr_charts.pyingtm-labs, paste this and save:
import pandas as pd
import matplotlib
matplotlib.use("Agg") # draw charts to files, no window needed
import matplotlib.pyplot as plt
weekly = pd.read_csv("weekly_usage.csv") # account_id, week, active_users
accounts = pd.read_csv("qbr_metrics.csv")["account_id"]
def usage_chart(account_id, path):
d = weekly[weekly.account_id == account_id]
fig, ax = plt.subplots(figsize=(9, 3.2), dpi=150)
ax.plot(d.week, d.active_users, linewidth=2.5, color="#0A6C76")
ax.fill_between(d.week, d.active_users, alpha=0.12, color="#0A6C76")
ax.set_title("Weekly active users this quarter", loc="left", fontsize=12)
ax.spines[["top", "right"]].set_visible(False)
ax.tick_params(axis="x", rotation=45, labelsize=8)
fig.tight_layout(); fig.savefig(path); plt.close(fig)
for acct in accounts:
usage_chart(acct, f"usage_{acct}.png")
print("saved", f"usage_{acct}.png")
- Run it:
python qbr_charts.py - Open one of the PNG files in VS Code (click it in the file list) to look at it.
What you should see: five lines starting with "saved", and five PNG charts in your folder, one per account, each showing 13 weeks of active users.
Let an LLM write the summary, with numbers locked
- Open
qbr_metrics.csvin VS Code and copy the header line plus the Acme Inc line. - Copy the prompt below, paste those two lines where it says
{{account_metrics_json}}, and send it to Claude.ai.
You write the executive summary slide of a quarterly business review.
Use ONLY the numbers in this data. Do not calculate new numbers. Do not round differently.
If a goal is behind target, say so plainly and suggest one cause from the data.
{{account_metrics_json}}
Output exactly 3 bullet points, each under 20 words:
1. The biggest result versus the goal.
2. The value delivered (hours saved, tasks automated).
3. The one thing to focus on next quarter.
- Now build the automatic check that catches invented numbers. Create
check_numbers.py, paste this and save:
import re, json
NUM = r"\d[\d,]*(?:\.\d+)?" # 194, 1,945 or 12.5 (not the full stop after "28.")
def numbers_are_grounded(summary: str, metrics: dict) -> bool:
clean = lambda nums: {n.replace(",", "") for n in nums}
allowed = clean(re.findall(NUM, json.dumps(metrics)))
used = clean(re.findall(NUM, summary))
return used <= allowed # every number used must exist in the source data
metrics = {"name": "Acme Inc", "hours_saved": 194, "tasks_automated": 1945,
"goal_1_current": 21, "goal_1_target": 28}
good = "Acme saved 194 hours, automated 1,945 tasks and reached 21 weekly active users against a target of 28."
bad = "Acme saved 250 hours this quarter."
print("good summary passes:", numbers_are_grounded(good, metrics))
print("bad summary passes:", numbers_are_grounded(bad, metrics))
- Run it:
python check_numbers.py - Replace the
goodtext with Claude's summary from step 2, and the numbers inmetricswith Acme's real numbers from the CSV. Run it again.
What you should see: good summary passes: True and bad summary passes: False. In a real build, any summary that fails is thrown away and replaced by a plain template, so a client never sees an invented number.
Generate the deck with python-pptx
- Make sure the library is installed:
python -m pip install python-pptx - Create
build_decks.pyingtm-labs, paste this and save:
import pandas as pd
from pptx import Presentation
from pptx.util import Inches
rows = pd.read_csv("qbr_metrics.csv").to_dict("records")
def bullet_slide(prs, title, lines):
s = prs.slides.add_slide(prs.slide_layouts[1]) # "Title and Content"
s.shapes.title.text = title
tf = s.placeholders[1].text_frame
tf.text = lines[0]
for line in lines[1:]:
tf.add_paragraph().text = line
return s
for r in rows:
prs = Presentation()
prs.slides.add_slide(prs.slide_layouts[0]).shapes.title.text = f"{r['name']} · Q3 2026 Business Review"
bullet_slide(prs, "Goal progress", [
f"{r['goal_1_name']}: {r['goal_1_baseline']} → {r['goal_1_current']} (target {r['goal_1_target']})"])
bullet_slide(prs, "Value delivered", [
f"{r['hours_saved']} hours saved this quarter",
f"{r['tasks_automated']} tasks automated",
f"{r['active_users']} active users"])
chart = prs.slides.add_slide(prs.slide_layouts[5]) # "Title Only"
chart.shapes.title.text = "Adoption"
chart.shapes.add_picture(f"usage_{r['account_id']}.png", Inches(0.5), Inches(1.6), width=Inches(9))
prs.save(f"QBR_{r['name'].replace(' ', '_')}.pptx")
print("built", r["name"])
- Run it:
python build_decks.py - Open one of the new
.pptxfiles in PowerPoint, Google Slides (upload it) or Keynote.
What you should see: "built" printed five times and five decks in your folder, each with a title slide, goal progress, value delivered and the account's own chart. Check every number against qbr_metrics.csv.
Put it on autopilot
- In VS Code, create
build_qbrs.py. Paste the whole Lab 11.2 code, then the whole Lab 11.4 code underneath it. Save, and test it once:python build_qbrs.py - In VS Code, create the folders
.github/workflowsinsidegtm-labs, and inside them a file namedqbr.yml. Paste this and save:
name: Build QBR decks
on:
schedule:
- cron: "0 6 1 1,4,7,10 *" # 06:00 UTC on Jan 1, Apr 1, Jul 1, Oct 1
workflow_dispatch: {} # lets you run it by hand too
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: { python-version: "3.12" }
- run: pip install pandas matplotlib python-pptx
- run: python build_qbrs.py
- uses: actions/upload-artifact@v4
with: { name: qbr-decks, path: "*.pptx" }
- Push everything to GitHub (the CSV files must be included):
cd ~/gtm-labs
git add build_qbrs.py qbr_metrics.csv weekly_usage.csv .github/workflows/qbr.yml
git commit -m "Automate QBR decks"
git push
- On GitHub, open your repo, click the Actions tab → Build QBR decks → Run workflow.
- When it shows a green tick, click the run and download qbr-decks at the bottom of the page.
What you should see: a green run and a zip with five decks, built in the cloud with no laptop involved. From now on it also runs by itself at the start of every quarter. Level up: add a final step that posts each deck link to the account's CSM in Slack with "review before sending".
Common mistakes
- Reporting activity (logins) instead of outcomes (goals moved).
- No baseline captured at kickoff, so you cannot prove change. Capture it on day one.
- Letting the LLM invent or recalculate numbers. Lock them and check them.
- Sending auto-generated decks without a human review.
Proof of work
QBR generator
- A repo that turns a CSV into one deck per account, with the number-grounding check.
- A sample deck (fake account) exported to PDF.
- A one-page ROI framework you could hand to a CS team.
Check yourself
Stage checklist
Stage 12 · Brand & proof
Dark Social & Community Attribution
Much buying starts in places software cannot see: a WhatsApp group, a podcast, a Slack community, a friend's advice. Learn to measure it anyway.
Learning outcomes
By the end of this lecture you should be able to:
- Define dark social precisely and explain why software attribution structurally cannot see it.
- Design a self-reported attribution instrument that avoids the main survey-methodology pitfalls of forced-choice questions.
- Explain LLM-based open-text classification as a measurement step, and how to validate its reliability.
- Read the SQL and Python behind a software-vs-self-reported cross-tab and a lagged correlation analysis, line by line.
- Distinguish correlation from Granger-style predictive evidence, and state correlation's limits precisely.
- Explain triangulation as a methodology for combining imperfect, differently-biased measurements into a more trustworthy estimate.
Prerequisites: Lecture 7 (attribution models) and Lecture 6 (survey methods: Van Westendorp). Reading time: about 50 minutes, plus 8 hours of labs.
Lecture notes
Lecture 12: Dark Social and Community Attribution
12.1 Dark social: definition and structural cause
The term dark social was coined by Alexis Madrigal in "Dark Social: We Have the Analytics Wrong" (The Atlantic, 2012), describing traffic that arrives at a website with no referrer information attached — typically because it was shared through a private channel (a direct message, a group chat, a screenshot, a conversation) rather than a public link a tracking script can observe. The structural cause is simple: web analytics attribute a visit by reading the HTTP Referer header, which records the URL of the page the visitor clicked from. A private message, a podcast mention, or spoken word of mouth generates no such header — the visitor simply opens a new browser tab and types the company's name, or clicks a link with no referrer context (many messaging apps strip it deliberately for privacy). The resulting visit is not missing data; it is correctly recorded as "direct" or "organic search," which is simply the wrong causal story, not an error in the measurement itself.
12.2 Self-reported attribution as a survey instrument
Self-reported attribution (SRA) asks the buyer directly, converting an unobservable behaviour into a direct measurement — at the cost of all the known weaknesses of self-report survey data. Two design choices determine most of an SRA instrument's quality. First, open text versus a forced-choice dropdown: a dropdown list of channels anchors the respondent on the options shown and systematically under-reports anything not listed (a classic survey-design bias), whereas an open text box — the manual's explicit recommendation — captures the respondent's own account without constraining it, at the cost of requiring a classification step afterward (§12.3). Second, recall bias: a respondent asked "how did you hear about us" during sign-up is reconstructing a memory, possibly from weeks earlier, and will tend to recall the most salient or most recent touchpoint rather than the first one, which can systematically overweight whichever channel happens to be most memorable (a podcast mention) over channels that are real but less distinctive (a passing mention in a Slack community). Neither weakness is eliminable, but both are mitigated by asking as close to the triggering moment as possible and by triangulating with other evidence (§12.7).
12.3 LLM-assisted open-text classification and its validation
Lab 12.1's prompt performs zero-shot classification: the model sorts free-text answers into a fixed category list it was given only in the prompt, with no separate training step. This is the same grounded-extraction discipline from Lecture 8.5 applied to a new task — a fixed category list plays the same role a JSON schema played there, constraining what the model is allowed to output. The methodological question this task raises, which the lab itself does not resolve, is reliability: does the classification actually match what a careful human would conclude from the same text? The standard way to check this is to have a human independently classify a sample (commonly 50–100 responses) and compute agreement between the human and the LLM — using a statistic such as Cohen's kappa, which corrects raw agreement for the agreement expected by chance. A GTM engineer running SRA classification at scale should budget for this spot-check before trusting the pivot table's category counts for a budget decision.
12.4 Comparing software and self-reported attribution
Lab 12.2's cross-tab makes the gap between the two measurement systems directly visible, row by row, rather than as a single aggregate statistic.
- select software_source, sra_primary, count(*) as signups from gtm_lab.signups group by software_source, sra_primary
- Grouping by two columns at once produces one row per combination that actually occurs in the data — every (software-recorded source, self-reported source) pair, with a count. This is a standard cross-tabulation (contingency table), the same structural idea as the attribution cross-tab discussed conceptually in Lecture 7, here computed directly in SQL rather than pre-aggregated.
- round(count(*) / sum(count(*)) over () * 100, 1) as pct_of_direct
- A window function (Lecture B.4) with an empty
over ()clause: this computes the grand total across every row in the result set (not per group — the empty parentheses mean the window spans the whole result), so each row's percentage is calculated against the full set of "direct" sign-ups being broken down, not just itself. This is a common pattern for "percentage of total" reporting: one pass computes the raw count per group, the window function computes the shared denominator, and the division happens in the same query. - where software_source = 'direct'
- Filters to only the rows where the tracking software recorded no identifiable source — this is specifically the "blind spot" population, and the query then asks what the self-reported answers reveal about what is actually inside it.
12.5 Community health and network effects
A community's value to each member grows, to a first approximation, with the number of other active members — the same qualitative dynamic as Metcalfe's law for networks, though community value depends on active engagement rather than raw membership count, which is exactly why Lab 12.3's five metrics are built around activity (weekly active member percentage, response time, member-to-member answer share) rather than total headcount. A community with 10,000 inactive members and a 45-minute median response time to questions is less valuable to a new member, and will retain fewer of them, than one with 500 members and a 4-minute response time — headcount alone inverts this comparison, which is why a metric suite built only on growth (new members per week) systematically misleads a team judging community health.
12.6 Lagged correlation and its limits
Correlation (Pearson's r) measures the strength and direction of a linear relationship between two variables, ranging from −1 (perfect inverse relationship) through 0 (no linear relationship) to 1 (perfect direct relationship). A lagged correlation asks the more specific and more useful question: does a variable's value k periods ago predict another variable's value now, which is the natural way to ask "does word of mouth lead to sign-ups, and after how long" rather than merely "do these two move together in the same week."
- df["mentions"].shift(lag)
.shift(lag)moves every value in thementionscolumn down bylagrows, so that the value originally recorded for week 1 now lines up against whatever row islagweeks later — this is the mechanical operation that turns an ordinary same-week correlation into a lagged one: comparing "mentions shifted forward by 2 weeks" against "sign-ups now" is exactly comparing mentions-two-weeks-ago against sign-ups-this-week.- .corr(df["signups"])
- Computes Pearson's r between the shifted mentions series and the (unshifted) sign-ups series — pandas automatically aligns the two series by row and ignores the rows that become empty at the start of the series after shifting.
- for lag in range(0, 5): ... print(f"mentions {lag} week(s) before signups: r = {r:.2f}")
- Repeats the calculation for every lag from 0 to 4 weeks and prints each one, so the result is a small table the analyst reads by eye to find which lag produces the strongest relationship — this is a simple, manual form of what time-series analysis calls a cross-correlation function.
Correlation, lagged or not, is not evidence of causation — a point the manual itself flags, and one that has a precise statistical refinement. Granger causality (Clive Granger, "Investigating Causal Relations by Econometric Models and Cross-Spectral Methods," Econometrica, 1969) formalises a narrower, testable claim: a variable x "Granger-causes" y if past values of x improve the prediction of y beyond what past values of y alone already provide. This is still not causation in the everyday sense (a third factor, such as a product launch, can drive both mentions and sign-ups, producing a spurious Granger-causal result too) but it is a meaningfully stronger and more specific claim than a bare correlation coefficient, and is the standard next step when a lagged correlation looks suggestive and the stakes justify more rigorous analysis.
12.7 Blended attribution as triangulation
Lab 12.5's three-column view — software share, self-reported share, and a reconciled estimate range — is an applied instance of triangulation, a methodological concept from social-science research (Norman Denzin, The Research Act, 1978): when no single measurement method is fully trustworthy, combining several methods with different, non-overlapping biases produces a more reliable estimate than any one method alone, because each method's blind spots are at least partially covered by the others' strengths. Software attribution's blind spot is exactly what it cannot observe (dark social, §12.1); self-reported attribution's blind spot is recall and framing bias (§12.2). Neither is corrected by adding more of the same kind of data; the correction comes specifically from holding the two different methods against each other and reasoning explicitly about where and why they disagree.
Lecture summary
- Dark social exists because private-channel sharing generates no referrer data for software to attribute; it is a structural gap, not a tracking bug.
- Self-reported attribution trades software's blind spot for recall and framing bias; open text reduces (but does not eliminate) anchoring compared with a forced-choice dropdown.
- LLM classification of open text should be validated against a human-labelled sample before its category counts are trusted for decisions.
- Lagged correlation (via
.shift()) finds the delay between a leading channel and an outcome; Granger causality is the appropriate next step when the stakes justify more than a bare correlation. - Triangulating software and self-reported attribution, each with different biases, produces a more trustworthy picture than either method alone.
Review and discussion questions
- Explain, mechanically, why a private message generates no referrer header while a public social-media link does.
- Why does the manual recommend an open text box over a dropdown for "how did you hear about us," and what does this choice cost in return?
- Explain what Cohen's kappa adds beyond simple percent-agreement when validating an LLM classifier against human labels.
- Walk through what
df["mentions"].shift(2)does to the mentions column, and why this is the operation that makes a lag-2 correlation meaningful. - A lagged correlation between community mentions and sign-ups is r = 0.94 at a 2-week lag. Explain why this is not sufficient evidence to conclude mentions caused the sign-ups, and name one concrete alternative explanation.
- Using the §12.7 case study, explain what each attribution method (software, self-reported) correctly captured and what each missed.
Further reading
- Alexis Madrigal, "Dark Social: We Have the Analytics Wrong", The Atlantic (2012).
- C. W. J. Granger, "Investigating Causal Relations by Econometric Models and Cross-Spectral Methods", Econometrica (1969).
- N. K. Denzin, The Research Act: A Theoretical Introduction to Sociological Methods (1978).
- J. Cohen, "A Coefficient of Agreement for Nominal Scales", Educational and Psychological Measurement (1960).
In one sentence
Ask buyers how they heard about you, sort their answers with an LLM, track community activity, and use simple statistics to show how word of mouth moves sign-ups.
The big idea
Dark social means sharing you cannot track: private messages, DMs, group chats, podcasts, word of mouth. The buyer hears about you there, then later types your name into Google. Your software says "source: direct" or "organic search", and gives credit to the wrong place.
Stage 7 attribution misses all of this. The fix is to combine three methods: ask people (self-reported attribution), watch communities (community ops metrics), and correlate activity with results (simple modelling).
Words you must know
- Dark social
- Sharing in private or untracked channels: DMs, group chats, podcasts, offline talk.
- Self-reported attribution (SRA)
- Asking "How did you hear about us?" in an open text box at sign-up or demo booking.
- Software attribution
- What tracking tools record (UTMs, cookies, referrers).
- Community ops
- Running a Slack or Discord community: onboarding, events, moderation, measurement.
- Branded search
- People searching your company's name. A good proxy for word of mouth.
- Correlation
- Two numbers moving together. Not proof that one causes the other.
- Lag
- The delay between a cause and its effect, such as a podcast airing and sign-ups 2 weeks later.
Practical labs
Add self-reported attribution and sort it with an LLM
- Open
forms.google.comand create a short "Book a demo" form: name, work email, company, and one required Paragraph question: "How did you hear about us?". Use free text, not a dropdown. Dropdowns hide the real story. - For practice answers, open
sra_answers.csvfrom Lab S.4 in VS Code and copy all 60 rows. - Copy the prompt below, paste the answers where it says
{{answers_with_ids}}, and send it to Claude.ai.
Classify each answer to "How did you hear about us?" into exactly one primary category
and up to two secondary ones. Categories:
podcast, linkedin_post, community_slack_discord, friend_or_colleague, newsletter,
search_engine, review_site, event_or_webinar, ai_assistant, cold_outreach, other.
Also extract the specific named source if given (e.g. podcast name, community name, person's role).
Return CSV with these columns: id,primary,secondary,named_source
Answers:
{{answers_with_ids}}
- Copy Claude's CSV, open a new Google Sheet, click cell A1 and paste. If it all lands in column A, use Data → Split text to columns.
- Click Insert → Pivot table: Rows =
primary, Values =id(COUNTA). Sort by count.
What you should see: a count per category. Usually "friend or colleague", "LinkedIn post" and "podcast" are much bigger than software attribution shows.
Compare what people say with what software says
- Run this cross-tab. Each row is "software recorded X, the person said Y":
select software_source, sra_primary, count(*) as signups
from gtm_lab.signups
group by software_source, sra_primary
order by signups desc;
- Now see what hides inside "direct" (traffic software cannot explain):
select sra_primary, count(*) as signups,
round(count(*) / sum(count(*)) over () * 100, 1) as pct_of_direct
from gtm_lab.signups
where software_source = 'direct'
group by sra_primary
order by signups desc;
- Write one sentence for a marketing leader: "X% of sign-ups our software calls 'direct' told us they came from podcasts, friends, LinkedIn and communities."
What you should see: "direct" is the biggest software source, and almost all of it is really podcasts, friends, LinkedIn posts, communities and newsletters. That is the evidence that wins budget for community and content.
Run community ops with real metrics
- Use a community you run (a study group works well) or create a free Discord server: + → Create My Own.
- Create channels with one purpose each:
#start-here,#introductions,#questions,#wins,#resources. - Pin a welcome message in
#start-herethat names the one first action: "Introduce yourself in #introductions: name, role, one thing you're building." - In a Google Sheet, track these five numbers every Friday:
| Metric | How to calculate | Healthy sign |
|---|---|---|
| Weekly active members % | members who posted or reacted ÷ total members | Stable or rising |
| Question response time | median minutes to first reply in #questions | Falling |
| Member-to-member answers % | replies not from the team ÷ all replies | Rising: the community runs itself |
| New member activation | % of new members who post within 7 days | Rising |
| Community-touched pipeline | deals where a contact is a member (match by email/domain) | The number leadership cares about |
- Automate the weekly digest. In Discord: channel settings (gear) → Integrations → Webhooks → New Webhook → Copy Webhook URL. Then send a digest from Git Bash/Terminal:
curl -X POST "https://discord.com/api/webhooks/YOUR/WEBHOOK" -H "Content-Type: application/json" \
-d '{"content":"Weekly digest: 12 new members, top question was about Clay waterfalls, next live session Friday 6pm."}'
What you should see: the digest appears in the channel, and after a few weeks your sheet shows whether the community is growing in activity, not just in member count.
Correlate word of mouth with sign-ups
The question: do mentions of us (in communities, on LinkedIn) lead to sign-ups, and how many weeks later?
- Open
weekly.csvin VS Code: one row per week with mentions, branded searches and sign-ups. - Create
word_of_mouth.py, paste this and save:
import pandas as pd
df = pd.read_csv("weekly.csv", parse_dates=["week"]).sort_values("week")
# columns: week, mentions, branded_searches, signups
for lag in range(0, 5):
r = df["mentions"].shift(lag).corr(df["signups"])
print(f"mentions {lag} week(s) before signups: r = {r:.2f}")
for lag in range(0, 3):
r = df["mentions"].shift(lag).corr(df["branded_searches"])
print(f"mentions {lag} week(s) before branded searches: r = {r:.2f}")
- Run it:
python word_of_mouth.py - Find the lag with the highest
rfor sign-ups, and for branded searches.
What you should see: correlation values (r) between −1 and 1 for each lag. In the practice data, sign-ups peak at a lag of 2 weeks (r ≈ 0.94) and branded searches at 1 week: people hear about you, search your name a week later, and sign up a week after that.
Build a blended attribution view
- In a Google Sheet, make one row per channel: Podcast, LinkedIn, Community, Friend/colleague, Search, Paid, Events.
- Column B, Software share %: from Lab 12.2, each channel's share of sign-ups according to software (most word-of-mouth channels get 0% here).
- Column C, Self-reported share %: from your Lab 12.1 pivot, each channel's share of answers.
- Column D, Your estimate range: write a range that sits between B and C, using what you learned in Lab 12.4. Example: "Podcast: 15–25%".
- Under the table, write two sentences on where software and people disagree most, and what budget decision that suggests.
What you should see: a small three-column table that leaders trust more than any single number, because it shows both lenses and an honest range.
Common mistakes
- Using a dropdown for "How did you hear about us?". You get "Google" for everything.
- Throwing away software attribution. Use both lenses; they answer different questions.
- Claiming correlation as proof.
- Measuring community by member count alone. Activity and answers matter more.
Proof of work
"What software can't see" report
- An SRA categorisation of 50+ answers with the LLM prompt you used.
- The software-vs-SRA cross-tab, with the biggest blind spot circled.
- A community health dashboard for a community you run or belong to (with permission).
Check yourself
Stage checklist
Stage 13 · Brand & proof
Public Teardowns & Revenue Portfolios
Show your judgment in public. Take real companies apart, explain what works and what you would change, and collect your 13 builds so far into a portfolio that gets you hired.
Learning outcomes
By the end of this lecture you should be able to:
- Explain a public teardown and portfolio as an application of signaling theory to the job search.
- Identify anchoring, the decoy effect, and the center-stage effect on a real pricing page and explain the behavioural mechanism behind each.
- Apply benchmarking methodology correctly, including unit normalisation, to compare pricing across companies fairly.
- Structure a public analysis for distribution, applying the attention-and-persuasion principles introduced across the course.
- Critique your own teardown for fairness and intellectual honesty before publishing it.
Prerequisites: Lecture 6 (value metric, pricing research) and Lecture A (positioning). Reading time: about 45 minutes, plus ongoing weekly work.
Lecture notes
Lecture 13: Public Teardowns and Revenue Portfolios
13.1 The portfolio as a costly signal
Michael Spence's "Job Market Signaling" (Quarterly Journal of Economics, 1973) models hiring as a problem of asymmetric information: an employer cannot directly observe a candidate's actual skill, so candidates who genuinely have the skill are motivated to produce a signal that is costly or difficult to fake, allowing employers to distinguish them from candidates who merely claim the skill. A CV line reading "skilled in SQL and Clay" is a cheap, easily copied claim; a public teardown that demonstrably analyses a real company's funnel, with specific numbers and a defensible recommendation, is a costly signal in Spence's precise sense — producing one well requires actually having the skill being claimed, which is exactly why hiring managers weight a portfolio far more heavily than a skills list. This reframes "build in public" from a vague career-advice slogan into a specific, theoretically grounded argument about which artefacts are persuasive and why.
13.2 Anchoring
Daniel Kahneman and Amos Tversky's "Judgment under Uncertainty: Heuristics and Biases" (Science, 1974) documented the anchoring and adjustment heuristic: when estimating an unknown quantity, people insufficiently adjust away from an initial reference point ("anchor") they were exposed to, even when that anchor is arbitrary. On a pricing page, showing an Enterprise plan at $2,000/month before showing a Pro plan at $99/month makes the $99 figure feel small by comparison, purely because of the order and magnitude of what was seen first — the $99 price itself has not changed, only the anchor against which a viewer unconsciously evaluates it.
13.3 The decoy effect
Huber, Payne and Puto, "Adding Asymmetrically Dominated Alternatives: Violations of Regularity and the Similarity Hypothesis" (Journal of Consumer Research, 1982) first demonstrated the decoy effect (also called asymmetric dominance): adding a third option that is clearly worse than one existing option but not directly comparable to another can shift preference shares between the original two options, even though the decoy itself is rarely chosen. A pricing page's middle tier is frequently a textbook decoy construction: the lowest tier is deliberately underpowered (low usage caps), making the middle tier look like the obviously sensible choice relative to it, while the top tier anchors the middle tier's price downward via §13.2's mechanism simultaneously.
13.4 Social proof and the center-stage effect
Robert Cialdini's Influence: The Psychology of Persuasion (1984) catalogued social proof — people infer correctness or value from what others are observed doing or choosing — as one of the most reliable levers of persuasion. Labelling a plan "Most popular" is a direct application: it tells the viewer what other buyers chose, which shifts preference toward that option independent of its actual features or price, an effect separately documented in choice research as the center-stage effect (options placed in the visually central or most emphasised position receive a preference boost purely from that placement). A teardown's pricing-psychology checklist (the manual's table) is, in full, a checklist of which of these well-documented behavioural effects a given pricing page has deployed.
13.5 Benchmarking methodology
Comparing prices across companies validly requires normalising to a common unit before comparing — exactly the value-metric discipline introduced in Lecture 6.3. Comparing "$49/month" against "$199/month" directly is uninformative without knowing what each includes; comparing price per unit of the value metric (price per enriched contact, price per automated task) is the valid comparison, which is why Lab 13.2 computes price ÷ units included for every plan before drawing any conclusion. A teardown that skips this normalisation step and simply ranks companies by sticker price is making exactly the value-metric-versus-proxy-metric error Lecture 6.3 warned against, now applied to competitor analysis rather than one's own pricing design.
13.6 Writing for distribution
The manual's HOOK/CONTEXT/WHAT I DID/FINDINGS/RECOMMENDATION/LIMITS/CTA template is a direct, compressed descendant of the AIDA model (Attention, Interest, Desire, Action) introduced in Lecture A.3 as a classical framing of the buying funnel, here repurposed for a different persuasion goal: earning a reader's attention and trust rather than a purchase. The hook exploits the same attention-capture principle as a headline; "what I'm not sure about" is a deliberate departure from pure persuasion technique, serving a credibility function instead — a teardown that states its own analytical limits is implicitly claiming its other claims were made carefully, which (per §13.1) is itself part of the signal being sent.
13.7 The job search as a GTM motion applied to oneself
Lab 13.5's outreach process — a target list with triggers, a short true message with one easy question, a tracked pipeline — is the outbound methodology of Lectures 3 and 4 (research, personalisation, a single low-friction ask) applied with the candidate as the product and the hiring manager as the buyer. This is the capstone observation of the course: every mechanism studied across thirteen stages — signal-based prioritisation, personalised relevance, a credible proof point, a single clear next step — is a general pattern for moving any specific stakeholder toward any specific action, and a job search is simply one more instance of that pattern, with a portfolio of real, demonstrable work (built across every lab in this course) as the credible proof point that gets a reply.
Lecture summary
- A public teardown and portfolio function as a costly signal in Spence's sense, which is why they outweigh a skills-list CV line in hiring decisions.
- Anchoring, the decoy effect, and the center-stage effect are specific, well-documented behavioural mechanisms, each independently testable on a real pricing page.
- Valid price benchmarking requires normalising to price-per-unit of the value metric before comparing across companies.
- Distribution-ready writing applies classical persuasion structure (AIDA-derived) while an honest statement of limits adds credibility rather than weakening the piece.
- The job search is a GTM motion like any other: targeting, personalised relevance, a credible proof point, and a tracked pipeline.
Review and discussion questions
- Explain, using Spence's signaling framework, why a working repository with a demo video is a stronger signal than the CV line "experienced with APIs."
- A pricing page shows Enterprise ($4,999/mo) first, then Pro ($299/mo) labelled "Most popular," then Starter ($49/mo) with a usage cap most buyers would exceed in a week. Identify all three behavioural techniques present and the mechanism behind each.
- Why is "$0.03 per enriched contact" a more valid cross-company comparison than "$49/month," and what step in Lab 13.2 computes it?
- Explain what the "what I'm not sure about" line in the distribution template is doing, beyond simple honesty.
- In the §13.7 case study, identify the specific Lecture 3 technique being reapplied and explain why the same mechanism (not just the same effort level) produces a comparable reply rate.
- Critique: is identifying a decoy-effect pricing tier on a company's page, by itself, a valid criticism of that company? What additional judgment does a rigorous teardown require per §13.4's key concept?
Further reading
- M. Spence, "Job Market Signaling", Quarterly Journal of Economics (1973).
- D. Kahneman and A. Tversky, "Judgment under Uncertainty: Heuristics and Biases", Science (1974).
- J. Huber, J. W. Payne and C. Puto, "Adding Asymmetrically Dominated Alternatives", Journal of Consumer Research (1982).
- R. Cialdini, Influence: The Psychology of Persuasion (1984).
In one sentence
Study a real company's pricing and growth funnel, compare it with benchmarks, write down clear recommendations, publish it, and link it to working proof of what you can build.
The big idea
Hiring managers see hundreds of CVs that say "skilled in Clay, SQL and HubSpot". Almost none show judgment: the ability to look at a business and say what to do next, and why. A public teardown shows exactly that, and builds an audience while you learn.
Most people stay stuck watching tutorials. Builders publish. Each teardown is proof you can think; each stage project is proof you can build. Together they are a revenue portfolio.
Words you must know
- Teardown
- A structured breakdown of how a company does something (pricing, onboarding, outbound) with your recommendations.
- Anchoring
- Showing a high price first so the next price feels reasonable.
- Decoy
- A plan designed mainly to make another plan look like better value.
- Good–better–best
- Three tiers, where most buyers pick the middle.
- Charm pricing
- Prices ending in 9 ($49 instead of $50), which feel lower.
- Time to value (TTV)
- How long from sign-up until a new user gets the first real result.
- Benchmark
- A comparison number from similar companies, such as median NRR.
Pricing psychology checklist
| Principle | What to look for on a pricing page |
|---|---|
| Anchoring | Is an expensive Enterprise plan shown first or prominently? |
| Decoy effect | Is one tier clearly worse value, pushing buyers to the next one? |
| Center-stage effect | Is the middle plan highlighted as "Most popular"? |
| Annual discount framing | "2 months free" vs "save 17%": same deal, different feel. |
| Value metric clarity | Can you predict your bill? (Stage 6) |
| Free plan or trial | What is the limit, and does it fall right after the Aha moment? (Stage 5) |
| Risk removers | Money-back guarantee, cancel anytime, no card needed. |
Practical labs
Do a PLG funnel teardown
- Pick a PLG product (Clay, Notion, Loom, Calendly, or your stage 3 "client"). Have a timer ready.
- Start the timer and sign up as a new user. Take a screenshot of every screen (Windows: Win + Shift + S; Mac: Cmd + Shift + 4) and note the time at each step.
- In a Google Doc, copy this table and fill it in:
| Funnel step | What happens | Time | Friction (1–5) | My recommendation |
|---|---|---|---|---|
| Landing page | Headline, CTA | 0:00 | ||
| Sign-up | Fields asked, SSO options | |||
| Onboarding | Questions, templates, empty states | |||
| First value (Aha) | The moment it "clicks" | |||
| Invite / share | Is there a reason to bring teammates? | |||
| Paywall / upgrade | When and how the upgrade is offered |
- Paste your best screenshots under the table.
- Write the three changes that would most improve conversion, each with a reason and a way to test it.
What you should see: a timed, screenshot-backed teardown with a clear "time to first value" and three testable recommendations.
Do a pricing teardown with benchmarks
- Pick one category (for example sales enrichment tools). Open the pricing pages of 4–5 competitors.
- In a Google Sheet, make columns: Company, Plan, Price/month, Value metric, Units included, Free plan?, Price per unit.
- Fill one row per plan. For Price per unit, type
=C2/E2and drag down. Then work out what 1,000 units (for example enriched contacts) costs on each. - Apply the pricing psychology checklist above to your main company. Mark each principle "used" or "not used", with a screenshot.
- Compare with a benchmark from this manual (for example usage-based companies' higher median NRR in Stage 6) and say what it suggests for their model.
- Write your verdict: one change to the pricing page, one change to packaging, and the risk of each.
What you should see: a comparison sheet where a reader can see at a glance who is cheapest per unit, plus a clear, fair verdict.
Write it so people actually read it
- Copy this structure into a Google Doc:
HOOK (1 line): A surprising, specific finding.
"Clay's pricing page hides its best feature behind a credit calculator."
CONTEXT (2 lines): What the company does and why this matters to the reader.
WHAT I DID (2 lines): "I signed up, timed onboarding, compared 5 competitors."
3 FINDINGS: One per line, each with a number or a screenshot.
MY RECOMMENDATION: The one change I would make and how I'd test it.
WHAT I'M NOT SURE ABOUT: One honest limit of your analysis.
CTA: "What would you change?" + link to the full teardown.
- Fill each part from your Lab 13.1 or 12.2 teardown. Keep the whole post under 250 words.
- Read it aloud. Cut every sentence that does not add a fact or an opinion.
- Add your best screenshot as the post's image, and publish it on LinkedIn. Tag the company only if your tone is fair.
- After 48 hours, note views, comments and any replies from the company in a sheet.
What you should see: a short, specific post with one strong finding. The "not sure about" line builds trust; companies often reply to thoughtful public teardowns, and some hire the author.
Build your revenue portfolio site
- Choose your tool. Easiest: a public Notion page (Share → Publish). Or build a one-page HTML site and drag it onto
app.netlify.com/drop. - Headline: "GTM engineer who builds [outcome]." Example: "I build data-driven pipeline engines for B2B SaaS."
- Featured builds (3): your strongest stage projects. Each card has the problem, what you built, the tools, a result or Loom demo, and the GitHub link.
- All builds: a simple list, one line each, linking to the proof (use the table below).
- Teardowns: links to your published analyses.
- How I work: 3 short principles (for example: "Test on 20 rows before 2,000").
- Contact: LinkedIn and email. Then send the link to two people and ask: "What do you think I do, after 10 seconds?"
| Stage | Portfolio item |
|---|---|
| 01 | Customer 360 dbt repo + CRM sync |
| 02 | Live signal router to Slack |
| 03 | Warmed sending infrastructure + verified, researched list |
| 04 | 1:1 outbound campaign with QA scores + contacts-per-lead |
| 05 | Tracking plan + Aha analysis + PQL definition |
| 06 | Pricing redesign memo + Stripe metering demo |
| 07 | Revenue truth dashboard |
| 08 | "Ask our calls" search + battlecard |
| 09 | Retention early-warning system |
| 10 | OAuth connector + ecosystem plan |
| 11 | QBR deck generator |
| 12 | "What software can't see" report |
| 13 | Teardown series |
| 14 | Agentic-GTM vendor audit + context-layer spec |
What you should see: a live link where a hiring manager understands in 10 seconds what you do, and can click through to working proof.
Turn the portfolio into interviews
- In a Google Sheet, list 30 companies you would love to work for. Use your stage 2 triggers: who is hiring GTM engineers, RevOps or growth roles right now?
- Add columns: Company, Contact (head of growth / RevOps), Trigger, Mini teardown link, Sent date, Reply, Next step.
- Pick your top 5. For each, do a 1-page mini teardown (Lab 13.1 or 12.2, shorter).
- Send it with a short note following stage 3 rules: specific, true, under 90 words, one easy question. Example: "I timed your onboarding and found one step that adds 4 minutes before first value. Short teardown attached. Useful if I send the fix too?"
- Update the sheet every week, like a sales pipeline.
What you should see: a live pipeline of conversations. You are now running your own GTM motion, with yourself as the product.
Common mistakes
- Teardowns that only describe. Every teardown needs a recommendation.
- Being harsh to get attention. Be fair; the company's team will read it.
- A portfolio of tutorial copies. Use a real company and real constraints.
- Waiting until it is perfect. Publish weekly; improve in public.
Proof of work
The portfolio itself
- A live portfolio site with 3 featured builds and all 12 listed.
- 4 published teardowns (one a week for a month).
- 5 mini teardowns sent to target companies, with replies tracked.
Check yourself
Stage checklist
Stage 14 · The agentic frontier
Agentic GTM & the Context Layer
AI agents are now running pieces of the outbound motion with nobody watching in real time — unevenly, inconsistently, and under real, documented backlash. Learn what "autonomous" actually means in a vendor product, the context-engineering discipline that decides whether an agent's output can be trusted at all, and how buyers are arming themselves with agents of their own.
Learning outcomes
By the end of this lecture you should be able to:
- Distinguish genuine multi-step agent automation from vendor autonomy marketing, using the three-tier AI-SDR market as a working example.
- Explain context engineering as the discipline that supersedes prompt engineering, including context rot and its four standard mitigations.
- Explain MCP's role in connecting GTM agents to data sources, and the "expose governed context, not raw data" design pattern.
- Diagnose context-layer failure modes, including the breadth-versus-boundaries tension between unifying data and leaking it.
- Read adoption and backlash data on AI-SDR tools without overstating what is established or understating what is documented.
- Explain how buyer-side AI agents and answer-engine optimisation are changing both inbound discovery and outbound targeting.
Prerequisites: Lectures 3 and 4 (outbound, especially §4.6's AI agent layer) and Lecture B.5 (LLMs in GTM systems). Reading time: about 55 minutes, plus 5–6 hours of labs.
Lecture notes
Lecture 14: Agentic GTM and the Context Layer
14.1 The AI-SDR market: three tiers, and autonomy as a selectable dial
§4.6 introduced the AI agent layer as something a team builds on top of its own strategy, list, offer and reply taxonomy. By 2026 a parallel market sells that layer pre-built: a wave of "AI SDR" products that claim to run outbound end to end. The market splits cleanly into three tiers, with how much a human has to approve declining as you move up them in price and ambition. At the top, vertically-integrated agents sell an entire motion as a product — Artisan's agent Ava claims to source leads from hundreds of millions of B2B contacts, run waterfall enrichment, write every message from scratch per recipient, and book meetings with CRM-based routing; 11x's Alice (outbound) and Julian (inbound) cover email, LinkedIn, SMS, WhatsApp and voice; Rox, positioned to consolidate point tools into a company's systems of record, reportedly reached a $1.2B valuation on roughly $8M of projected ARR in 2026 — a valuation-to-revenue ratio press coverage calculated at roughly 150×, a sign of how far ahead of demonstrated results the category's funding has run. In the middle sits horizontal data and workflow tooling: Clay's research agent Claygent, which answers bounded research questions inside a table rather than running a motion end to end, and similar orchestration layers. At the bottom, CRM incumbents are retrofitting agents onto existing systems of record — Salesforce's Agentforce, HubSpot's Breeze, Einstein as a purely advisory layer with a human executing every action.
The teachable pattern repeats across nearly every vendor profile in this market: genuine multi-step automation — research, drafting, enrichment, routing — is real and shipping. Full autonomy is usually a configuration option, not a fixed property of the product: Artisan's own documentation describes per-message approval and objection-only escalation as standard settings on the same page that claims most customers run "fully autonomously," and HubSpot's Breeze explicitly scopes itself as "semi-autonomous within defined parameters" rather than claiming more than that. The step with the highest deliverability and reputational risk — final send — is consistently where a vendor's stated restraint is most likely to not match the product's shipped default behaviour, more often on LinkedIn than on email.
14.2 Grok Bot, and the pattern behind every autonomy claim
"Grokbot," as practitioners use the term, is xAI's Grok Bot: a general-purpose autonomous-agent platform, not a dedicated sales product, that launched into beta in August 2026. Each Bot runs on a persistent cloud computer that keeps working after the user closes their laptop, and signs into existing tools through their ordinary interfaces — operating a browser or app "as if it were a person logged in as you" — which lets it reach systems with no API at the cost of auditability: there is no dry-run mode, approvals function as guidance rather than an enforced stop, and an action audit log is listed only as "upcoming." Grok Bot ships several preset roles, one of which is Sales Outbound: its own guide describes pulling account history and usage data from a CRM and a call-intelligence tool to research accounts, drafting a first-touch email that opens on a real signal, cross-checking contacts against enrichment tools, and sorting prospects into a clear-versus-flag queue for human review.
The same guide states that sending is gated — "never auto-send" — and, in the same document, describes a companion LinkedIn bot sending connection requests on its own once it has checked a daily cap. This is not a one-off inconsistency; it is the single clearest instance of §4.6.1's general pattern: a vendor's autonomy claim, read against its own documentation, routinely does not survive contact with the product's documented default behaviour. No independent, non-vendor reporting of Grok Bot's sales use was found as of this writing, and no audited customer-count or benchmark figure exists for the Sales Outbound role outside vendor and partner content. The lesson to carry forward is not "Grok Bot is good or bad" — it is too new and too thinly covered to say — but the discipline of checking a product's own fine print against its own headline claim, on this product and on every other one in this chapter.
14.3 Context engineering: context rot, and four ways to fight it
Running underneath the agent-product market is a separate, more durable discipline: context engineering, which Anthropic defines as the set of strategies for curating and maintaining the optimal set of tokens available to a model during inference — explicitly the natural extension of prompt engineering rather than a replacement for it. Prompt engineering shapes the instructions for one call; context engineering governs the entire token budget — system instructions, tool definitions, retrieved data, message history — across a multi-step agentic task, which is the shape every pipeline in this manual from §3.5 onward actually takes.
Anthropic names the central failure mode context rot: recall accuracy degrades as context grows, because every additional token draws against a finite, diminishing-returns attention budget, so simply stuffing more data into a context window does not reliably make an agent better informed — past a point, it makes the agent worse at using what it already has. Four mitigations recur in current practice: compaction (summarising history as it nears the context limit, so older detail is compressed rather than silently dropped); structured note-taking (an agent writing its own persistent memory outside the context window, to be read back in later rather than re-derived); sub-agent architectures (a specialised agent working on its own clean context window and returning a condensed summary to the coordinating agent, rather than one agent carrying the whole task's history); and just-in-time retrieval (loading a specific record only at the step that needs it, rather than front-loading everything an agent might conceivably need).
14.4 MCP and the GTM context layer
The Model Context Protocol (MCP) is an open protocol — host, client and server — for exposing a tool's data and actions to an agent in a standard way, informally described as "USB-C for AI": one connector shape that many agents and many tools can both speak, in place of a custom integration per agent-tool pair. By 2026 MCP has become the default connective layer specifically for GTM: the major platforms this manual already names — CRM systems, call-intelligence tools, enrichment platforms — shipped MCP servers within a few months of each other in 2026, and one call-intelligence vendor's own MCP server is a deliberately instructive design choice: rather than exposing raw call transcripts, it exposes analysed context — account summaries, deal risk, next steps — to whichever agent connects to it.
"Don't expose raw data, expose governed context" is worth stating as its own design rule, because it is the MCP-era version of §3.5's grounded-extraction pattern: a research step that returns structured, bounded JSON rather than a raw webpage dump is more reliable for exactly the reason a governed MCP server is more reliable than a raw database connection — the hard work of deciding what matters has already been done once, upstream, instead of being redone imperfectly by every agent that connects. The practitioner caveat that recurs across this market is equally important to teach alongside the enthusiasm: MCP does not fix dirty data. An agent querying a connected system surfaces whatever is actually in that system; a stale CRM field, an unqualified ICP or an unmaintained data warehouse (Lecture 1) produces bad agent output faster through MCP, not slower, because the agent now acts on it immediately instead of waiting for a person to notice it first.
14.5 Context-layer failure modes: breadth versus boundaries
The documented failure modes of a poorly built context layer are concrete and recurring: an agent citing a call that never happened because it read a duplicate contact record instead of the real one; addressing a prospect by a title they left six months earlier because a CRM field was never refreshed; treating a deal as still open minutes after it closed, because of ordinary polling lag between systems; guessing at a field name or an enum value the schema never specified, producing a corrupted write instead of a clean one. Each failure traces to the same root identified in §3.5 and §4.6: an agent's output is only as reliable as the context it was given, and a context layer that skips entity resolution (confirming which record is actually the right one before reasoning about it) inherits every downstream ambiguity in the data it reads.
A separate, less intuitive failure mode runs in the opposite direction from "siloed data is the problem." A sales agent given broad read access to a shared project space combined a draft, unreleased feature roadmap, a customer's own feature request and an old internal sales note into an outreach email that implied a product commitment nobody had actually made — not because any one piece of context was wrong, but because nothing in the agent's access scope distinguished "available to read" from "safe to act on in front of a customer." The operating principle this produces: permission controls availability; context controls influence. Connecting every system to every agent is not the fix for siloed data, because unscoped breadth causes exactly the kind of cross-team leakage unification was supposed to prevent — the context layer has to solve breadth (no dangerous silos) and boundaries (scoped, purpose-limited access) as two separate engineering problems, not one.
14.6 What the adoption and backlash data actually show
No single authoritative, independently audited adoption figure for AI-SDR tools exists; most specific percentages in circulation trace to vendor blogs or content aggregators rather than primary analyst reports, and this chapter deliberately teaches that absence rather than papering over it with a confident-sounding number. What is verifiable at the primary source is more sobering than the marketing: one major analyst firm projects AI agents will outnumber human sellers roughly ten to one within a few years, while fewer than 40% of sellers report those agents actually improved their productivity — "more agents will not automatically mean more productivity," in the words of one analyst quoted on the point, because "agents are only as effective as the systems they operate within," which is §14.3 and §14.4's argument stated as an industry warning rather than a course lesson. A separate practitioner survey found that the large majority of surveyed companies reported no tangible result from an AI-SDR deployment, and only a small minority generated real revenue from one.
Where real, named numbers do exist, the same pattern sits underneath nearly every headline figure: amplification of an already-good process, not replacement of it. A detailed six-month, first-person deployment across three platforms produced a real, measurable result — but only alongside 15–20 human hours a week managing the agents, a multi-week deliverability warm-up, and response rates that ran noticeably higher in the weeks with more human attention, not less. This is §4.6's "capstone, not entry point" argument confirmed by the market's own best-documented case: the agent amplified a strategy, list and offer that were already sound; it did not substitute for having them.
Underneath both the hype and the backlash sits a structural squeeze this manual's own §3.3 already predicted from first principles: rising AI-generated outbound volume is reported, across multiple independent sources, to be degrading deliverability industry-wide, as mailbox providers tighten bulk-sender enforcement and recipients adopt their own filtering. At least one shipped consumer product now auto-archives and labels messages it classifies as cold outreach and notifies the sender they were filtered, and one analyst report finds a large majority of B2B technology buyers already use an AI agent somewhere in their own purchasing process — meaning a growing share of outbound is screened by an agent before any human ever reads it. §3.3's deliverability math was never only about warmup schedules; this is what happens to that math when every sender on the network starts running the same AI-assisted playbook at once.
14.7 Buyer-side agents and answer-engine optimisation
Everything above concerns the seller's side of the transaction. The buyer's side is moving at least as fast, and in one respect faster: one analyst found a markedly higher share of B2B buyers already using agentic AI somewhere in procurement than the share of suppliers using agentic AI to sell to them — buyers are currently ahead of sellers in adopting this technology, not behind. A live, named example of where this leads: an agent built on a card network's new trusted-agent protocol sourced, compared, ordered and paid for a product sample entirely within a buyer's own pre-set spending controls, with no human clicking "buy." Consumer agentic checkout, by contrast, has underperformed its own hype — one major AI lab scaled back its in-chat checkout feature after conversion ran at a fraction of normal e-commerce rates — which is a useful caution against assuming B2B will follow the consumer timeline: B2B purchasing needs contract pricing, approval chains and multi-party negotiation that a one-price, one-buyer consumer checkout flow was never built to handle.
Discovery is shifting in parallel. Survey data from B2B buyers shows a majority now start vendor research with an AI chatbot more often than with a traditional search engine, up sharply from a year earlier, with AI-chat recommendations now outranking review sites, analysts and vendor websites as the top influence on which vendors make a shortlist. The same research finds that brand recognition barely moves whether an AI answer engine surfaces a vendor at all — use-case fit and clear, specific product description matter far more — though buyers still verify afterward: most also use traditional search and visit the vendor's own site before deciding, so an AI answer builds the shortlist rather than replacing diligence. Answer-engine optimisation (AEO), sometimes called generative-engine optimisation (GEO), is the practice of making a company's own content legible and citable to these answer engines, the inbound-side mirror of this chapter's main argument: AI-mediated discovery rewards verifiable specificity and original data over generic, high-volume content, for the same reason a context layer built on governed, well-scoped data beats one built on a raw data dump.
Lecture summary
- The AI-SDR market splits into vertically-integrated agents, horizontal data/workflow layers and CRM incumbents retrofitting agents; "autonomous" is a configurable setting, not a fixed property, and final-send behaviour is where vendor claims most often diverge from documentation.
- Grok Bot ("Grokbot") is a real, general-purpose agent platform with a Sales Outbound preset, not a dedicated sales product, and its own documentation contains the exact autonomy-claim contradiction this chapter teaches you to look for in any vendor.
- Context engineering supersedes prompt engineering: context rot degrades recall as context grows, and compaction, structured note-taking, sub-agent architectures and just-in-time retrieval are the four standing mitigations.
- MCP is the emerging standard for connecting GTM agents to data sources; the pattern worth copying is exposing governed, analysed context rather than raw data, and MCP never fixes underlying data quality.
- Context-layer failures run in two directions — stale or unresolved data causing hallucination, and unscoped breadth causing cross-team leakage — and both must be engineered against separately.
- Adoption data is thin and mostly unaudited; the best-documented pattern is amplification of an already-sound process rather than replacement, and backlash (fabricated claims, deliverability collapse, buyer-side filtering) is as well-documented as the adoption story.
- Buyers are adopting agentic AI and AI-mediated discovery at least as fast as sellers are adopting agentic outbound, and both inbound (AEO) and outbound now reward verifiable specificity over generic volume.
Review and discussion questions
- A vendor's marketing page says its agent runs "fully autonomously." What specific evidence from the vendor's own documentation would you look for before accepting that claim, and why?
- Explain context rot in your own words, and match each of the four mitigations to a pipeline or pattern already taught earlier in this manual.
- Why is "expose governed context, not raw data" a better MCP design rule than simply connecting an agent to every available data source?
- Describe a scenario where adding more data access to an agent makes its output less trustworthy, not more, and name the operating principle that explains why.
- A practitioner survey reports that most companies see no tangible result from an AI-SDR tool, while a named case study reports a real one. Are these findings in tension? Explain using §14.6's "amplification, not replacement" pattern.
- How should a seller's outbound practice change, if at all, now that a large share of B2B buyers are reported to already use an AI agent somewhere in their own purchasing process?
Further reading
- Anthropic, "Effective context engineering for AI agents" (2025) — the primary-source definition of context engineering, context rot, and the four mitigations taught in §14.3.
- Gartner, cited via trade press coverage of seller-to-agent ratio projections and seller-reported productivity data (2026).
- TechCrunch, investigative reporting on fabricated customer claims and revenue-recognition practices in the AI-SDR category (2025–2026).
- G2, "The Answer Economy" research report on B2B buyer use of AI chatbots in vendor discovery (2026).
- Vendor and practitioner sources (Artisan, 11x, Clay, HubSpot, Salesforce, Gong, ZoomInfo, Warmly, xAI) for product and architecture claims in §14.1, §14.2 and §14.4–14.5 — cited throughout as practitioner and vendor material, explicitly distinguished in the lecture text from independently verified findings, not as peer-reviewed research.
In one sentence
AI agents can now research, draft, enrich and route outbound — unevenly and under real backlash — and whether any of it can be trusted comes down to the quality of the context layer underneath it, not the cleverness of the model running on top.
The big idea
Every vendor in this market wants to sell you "autonomous." The honest version is narrower and more useful: real multi-step automation exists, final decisions are usually still gated to a human somewhere, and the single biggest driver of whether an agent's output can be trusted is the same thing this whole manual has been teaching since Stage 1 — clean, well-scoped, well-governed data, now called "context" because an agent is reading it instead of a person.
Words you must know
- AI SDR
- A product that claims to run some or all of outbound prospecting — research, writing, sending, replying — with an AI agent instead of a human rep.
- Context engineering
- Curating and maintaining the right set of information an agent has access to during a task, as distinct from writing a single prompt.
- Context rot
- An agent getting worse at using its available information as that information grows, because attention is a limited budget, not an unlimited one.
- MCP (Model Context Protocol)
- An open standard for connecting an AI agent to a tool's data and actions, so one connector shape works across many agents and many tools.
- Context layer
- The governed, structured layer between raw company data and an agent — resolving which record is really which, and scoping what each agent or skill may read.
- AEO / GEO
- Answer-engine (or generative-engine) optimisation: making content legible and citable to AI chat tools buyers now use to research vendors, alongside or instead of search engines.
How it works, step by step
Practical labs
Audit a vendor's autonomy claims
- Pick one AI-SDR or agent vendor (your own tool stack, or one named in this chapter).
- Find its marketing page's autonomy claim — the exact sentence that says or implies "no human needed."
- Find its product documentation, help center or pricing page's description of approval settings, escalation rules, and what happens on an edge case (an angry reply, an unclear intent, a compliance request).
- Write one paragraph: does the documentation support the marketing claim, partially support it, or contradict it? Quote the specific lines on both sides.
- Identify the single highest-risk action this agent can take (usually: sending something external) and write down exactly what triggers it and whether a human reviews it first.
What you should see: a short, evidence-based verdict on one real vendor's autonomy claim — the same discipline §14.2's Grok Bot case study applies, now run by you on a product you can actually inspect.
Design a context layer for one agent task
- Pick one agent task from earlier in this manual (for example, §4.5's reply-intent agent, or §4.6's enrichment skill).
- List every data source that task could plausibly read (CRM fields, call transcripts, product usage, other teams' notes).
- For each source, mark it in scope or out of scope for this specific task, and write one sentence for each exclusion explaining the risk it avoids (§14.5's breadth-versus-boundaries principle).
- Write an entity-resolution rule: how does the agent confirm it has the right record (not just a record) before acting on it?
- Write one escalation rule: a situation where this task must stop and hand off to a human rather than complete on its own.
What you should see: a one-page context-layer spec for one real task — scoped sources, an entity-resolution rule, and an escalation rule — that could be handed to an engineer to actually build.
Inspect an MCP server's governed context
- Connect one MCP server for a tool you already use (a CRM, a data/enrichment tool, or any other MCP-enabled connector available to you) to an MCP-capable assistant.
- Ask the assistant to list the specific actions and data fields that connector exposes.
- Compare that list with everything the underlying tool actually stores. Write down what is deliberately not exposed.
- For one exposed field, ask: is this raw data, or already-analysed/summarised context (§14.4's distinction)? Write one sentence on which it is and why that choice makes sense (or doesn't) for this connector.
What you should see: a concrete, first-hand example of "governed context" (or its absence) in a real MCP server, not just the abstract idea from the lecture.
Run an AEO/GEO visibility check
- Pick a buying question in your ICP's category (for example, "best tool for X for a 50-person company").
- Ask it, worded identically, to two or three different AI chat tools and to a traditional search engine.
- Record which vendors each one surfaces, in what order, and whether each AI answer cites a source.
- For your own company (or your Stage 3 "client"), check whether it appears anywhere in the AI answers. If not, read its website's product/use-case pages and identify what a buyer-facing page would need to state more clearly or specifically to be citable (§14.7).
What you should see: a short comparison table of what each discovery channel surfaces for the same question, and one concrete content change that would make your company more citable.
Write the guardrails you would actually ship
- Using your Lab 14.1 vendor audit and Lab 14.2 context-layer spec, write three guardrails you would require before letting any agent run this task unattended, modelled on §4.6's three guardrails (small test first, ask before paid spend, stop when ambiguous).
- For each guardrail, write the specific signal that trips it (a number, a confidence threshold, a reply type) — not a vague description.
- Write one sentence on what "fully autonomous" should mean for this specific task, in measurable terms, rather than as a marketing word.
What you should see: three concrete, triggerable guardrails for one real agent task — the kind of specification a vendor's own documentation should contain, and that §14.1–14.2 showed you how to go looking for when it doesn't.
Common mistakes
- Taking a vendor's "autonomous" claim at face value instead of checking its own documentation for approval gates and escalation rules.
- Connecting an agent to every available data source "to be safe," which causes exactly the cross-team leakage unscoped breadth is documented to cause.
- Treating a single vendor case study, in either direction, as proof that AI-SDR tools work or don't — the honest reading is amplification of an already-sound process, not a verdict on the category.
- Optimising only for traditional search while a growing share of buyer research happens inside an AI chat tool that rewards different, more specific content.
Proof of work
An evidence-based agentic-GTM assessment
- A written audit of one real vendor's autonomy claims against its own documentation (Lab 14.1).
- A one-page context-layer spec for one agent task, with scoped sources, an entity-resolution rule and an escalation rule (Lab 14.2).
- An AEO/GEO visibility comparison for one buying question in your ICP's category, with one concrete content fix (Lab 14.4).
- Three measurable guardrails for the task you specified, each with a specific trigger (Lab 14.5).
Check yourself
Stage checklist
Bonus lesson · Clay in practice
Clay Signals & Scoring
From a live Clay help session (13 Oct 2026, Sabrina Carver and Jared Waxman): how experienced builders save credits, find whole buying groups, and score accounts with signals.
In one sentence
Most Clay work does not need an AI agent: store fixed answers in reference tables and look them up for free, use AI only where judgment is needed, ask for JSON, and do the final scoring with a plain formula.
The five rules
- Write it down once, look it up for free. Answers that never change (title → department, LinkedIn industry → CRM industry) go in a reference table. "Lookup single row in another table" is Clay's free VLOOKUP.
- Use AI only for judgment. Comparing messy job titles needs AI. Adding up a score does not.
- Ask for JSON, not "fields". JSON reliably returns null when nothing is found, splits into columns, and handles lists. Fields often returns junk text like "result could not be found".
- Build reusable Claygents with clear names. Name them object + what it does + input, e.g. "Universal Location Parser, Unstructured Location".
- Score with six signal types, finish with a formula. Then changing a weight means editing one number, not rerunning every row.
Free moves most builders forget
| Clay tool | What it does | Example |
|---|---|---|
| Lookup single row in another table | Finds one matching row, returns all its columns | "Software Development" → "Technology" |
| Lookup multiple rows in another table | Returns every matching row | All titles that belong to Sales |
| Send table data | Writes rows into another table | New contacts → Contacts table |
| Formula via meta prompter | Turns an array into "a, b, c" text | Ask it to "add space after comma" |
Industry mapping: LinkedIn and Clay use about 450 industries; most CRMs use 30 to 50. Ask Claude or ChatGPT to map them once, load the result as a reference table, and look it up on every run.
Finding the missing people (multi-threading)
- Column A: every title in the buying group you want (VP Sales, Head of RevOps, CFO).
- Column B: titles already at that account in your CRM.
- Column C: a cheap AI step (about 0.1 credit, no web research, low-credit model) lists only the missing titles. AI is needed because "VP of Sales" and "Vice President of Sales" do not match as plain text.
- Feed Column C into Find contacts at company (not the general Find people), which takes different titles per account.
- Test title matching both ways: "contains" is strict and can miss variants; "is similar to" finds more but can drift into roles like HR.
- Tidy up: group and collapse import columns, rename results exactly ("Contact Name", not "Name"), colour-code groups. Test on 10 rows, or turn auto-run off and run 2 or 3.
The six signal categories
| Category | Examples | Note |
|---|---|---|
| Firmographics | Industry, size, location | Usually 40–60% of the score: the kill switch. Keep it even if your search already filtered on it, so inbound leads get scored too. |
| Technographics | Tools used or missing | No integration with their main tool lowers the score. |
| Hiring | Who they are hiring | More salespeople, new GTM roles. |
| Intent | Form fills, demo requests, visitor ID (Lead Forensics, Sift) | Best timing clue. |
| Risk | Layoffs, lost clients, closures, bankruptcy | Often forgotten. Usually subtracts, but can be a positive (a company lagging on AI may need warming up). |
| Growth | Expanding headcount, products, offices | Whether they grow, not who they hire. |
Sabrina's signal prompts at a glance
| Prompt | Scoring |
|---|---|
| Headcount growth (24 months) | Base 0–4 by growth % (25%+ = 4) × recency (0–6 months 1.0 down to 19–24 months 0.4) × 1.25, max 5 |
| Hiring spike | 0–3 months ago 4 · 4–6: 3 · 7–12: 2 · 13–18: 1.5 · 19–24: 0.5 · none 0 |
| Layoff health (reverse) | None in 24 months 4 · 19–24: 3 · 13–18: 2.5 · 7–12: 1.5 · 4–6: 0.5 · 0–3: 0 · minus 0.5 for repeat rounds |
| Product launch | Within 12 months 2 · within 3 years 1 · none 0 |
| AI investment | Own data centres 2 · sells AI products 1 · neither 0 |
| Great Place to Work | Certified +1 · updated within 12 months +1 · lists in 2+ years +1 · trust 90%+ +2, 70–89% +1 |
| Benefits broker (Form 5500) | Tier 1 (Mercer, WTW, Aon, Alliant, MMA, Sequoia, Gallagher) 5 · other confirmed broker 2 · unknown null |
Every prompt follows the same recipe (#CONTEXT#, #OBJECTIVE#, #INSTRUCTIONS#, #EXAMPLES#, #INPUTS#), researches one signal only, uses public pages only, checks it is the right company, and returns null instead of guessing. See the Builder's toolkit for the template.
Free public data worth knowing
- EIN (US tax ID): unlocks legal filings such as Form 5500, which can reveal a company's benefits broker and even its open enrollment timing. Pitch benefits just before that window.
- NPI registry: free US database of healthcare providers (workplace, specialty), reachable from Clay's HTTP API column.
- Great Place to Work: happy employees suit a benefits pitch; unhappy ones may mean an opening for help desk or automation.
- Industries off LinkedIn: scrape university staff directories; find manufacturing bosses through Google Maps and reviews.
- Free Clay plan tip: spend credits transforming data you have rather than buying new enrichment.
Rebuild the scoring model on 10 companies
- Make a reference table. Ask Claude.ai: "Map these LinkedIn industries to these 6 CRM industries: [paste]." Save the answer as a CSV, then in Clay click + New → Import CSV to create a table called "Industry map".
- Load companies. In a new Clay table, use Find companies with a limit of 10, or import 10 domains from a CSV.
- Free lookup. Add Lookup single row in another table, point it at "Industry map", and match on the LinkedIn industry column. Check it returns your CRM industry at no credit cost.
- Two signal columns. Add two AI columns with JSON output: Hiring Spike Score and Layoff Health Score. Use the scoring rules in the table above as the prompt's instructions, and the 5-part recipe from the Toolkit.
- Firmographic points. Add a formula column that gives 0–50 points for fit, for example 25 for the right size plus 25 for a target industry.
- Final score. Add a formula column: firmographic points + (hiring score + layoff score) ÷ 8 × 50. Use the meta prompter if you are unsure of the syntax.
- Change the formula to double the layoff weight (and divide by 12 instead of 8). Watch every row update.
What you should see: a ranked list of 10 accounts, where only the two signal columns cost AI credits, and changing a weight updates every row instantly for free.
Check yourself
Checklist
Reference
GTM Maths Cheat Sheet
Every number a GTM leader will ask you about, with the formula, a worked example and a common rule of thumb.
In one sentence
Revenue health comes down to how much it costs to win a customer, how much they are worth, and how well you keep and grow them.
Revenue basics
| Metric | Formula | Example |
|---|---|---|
| MRR (monthly recurring revenue) | Sum of all monthly subscription revenue | 40 customers × $500 = $20,000 |
| ARR (annual recurring revenue) | MRR × 12 | $20,000 × 12 = $240,000 |
| ACV (annual contract value) | Yearly value of one contract | A $1,000/month contract = $12,000 ACV |
| ARPA (average revenue per account) | MRR ÷ number of customers | $20,000 ÷ 40 = $500 |
Cost to acquire and value of a customer
| Metric | Formula | Example | Rule of thumb |
|---|---|---|---|
| CAC (customer acquisition cost) | Sales + marketing spend ÷ new customers won | $60,000 ÷ 10 = $6,000 | Lower is better; compare with LTV |
| CAC payback | CAC ÷ (ARPA × gross margin) | $6,000 ÷ ($500 × 80%) = 15 months | Under 12 months is strong; a 2026 benchmark put the median near 16 |
| LTV (lifetime value) | ARPA × gross margin ÷ monthly churn rate | $500 × 80% ÷ 2% = $20,000 | Only as good as the churn estimate |
| LTV : CAC | LTV ÷ CAC | $20,000 ÷ $6,000 = 3.3 | 3 or more is the classic target |
Try it · Unit economics
LTV, LTV:CAC and payback
Retention
| Metric | Formula | Example | Rule of thumb |
|---|---|---|---|
| Logo churn rate | Customers lost ÷ customers at start | 3 ÷ 100 = 3% this month | Lower for enterprise than SMB |
| NRR | (Start MRR + expansion − contraction − churn) ÷ start MRR | (100 + 15 − 5 − 5) ÷ 100 = 105% | Median about 102%; 110%+ top quartile (Stage 9) |
| GRR | (Start MRR − contraction − churn) ÷ start MRR | (100 − 5 − 5) ÷ 100 = 90% | Can never exceed 100% |
| SaaS quick ratio | (New MRR + expansion MRR) ÷ (churned MRR + contraction MRR) | (30 + 10) ÷ (8 + 2) = 4 | 4 or more is often called healthy growth |
Sales pipeline
| Metric | Formula | Example | Rule of thumb |
|---|---|---|---|
| Conversion rate | Moved to next stage ÷ entered stage | 48 SQLs ÷ 160 MQLs = 30% | Track every stage (Stage 7) |
| Win rate | Won ÷ (won + lost) | 20 ÷ 80 = 25% | Compare by source and rep |
| Sales cycle | Average days from opportunity created to won | 54 days | Shorter means faster cash |
| Pipeline coverage | Open pipeline ÷ quota for the period | $900k ÷ $300k = 3× | About 3× is a common target |
| Pipeline velocity | (Open opps × win rate × average deal) ÷ cycle days | (60 × 25% × $12k) ÷ 54 = $3,333 a day | Raise any of the top three or cut the cycle |
| ROI | (Value gained − cost) ÷ cost | ($72k − $36k) ÷ $36k = 100% | Show the inputs (Stage 11) |
Rules of thumb vary by company size, segment and price point. Use them as a starting point, not a verdict.
Check yourself
Reference
Getting Hired as a GTM Engineer
What the roles are called, what hiring managers test, how to answer common interview questions, and what to do in your first 90 days.
Job titles to search for
The same work goes by many names. Search all of these: GTM Engineer, Growth Engineer, GTM Operations, Revenue Operations (RevOps) Analyst or Engineer, Marketing Operations, Sales Operations, Growth Ops, Clay Specialist, Outbound Automation Specialist. Agencies that build outbound systems for clients also hire for this work and often accept remote talent.
What hiring managers look for
| Skill | How they test it | Your proof from this manual |
|---|---|---|
| Business sense | "Why would you build this?" questions | GTM canvas (Part A), teardowns (Stage 13) |
| Data skills | Live SQL, or reading a messy CSV | Toolkit SQL, Stage 1 and 6 repos |
| Automation | Build a small Clay or n8n flow in a take-home | Stages 2, 3 and 4 |
| AI judgment | "Where would you NOT use AI?" | Clay bonus lesson, Stage 5 QA scores |
| Communication | Explain a build to a non-technical sales leader | Your Loom videos and READMEs |
Common interview questions and how to answer
| Question | A strong answer includes |
|---|---|
| Walk me through something you built. | The problem, who it helped, what you built, the result (a number), what you would change. Two minutes. |
| How would you find the right 500 accounts for us? | Define the ICP first, pull with firmographic filters, add 2–3 timing signals, score with a formula, test 20 rows by hand. |
| Our reply rate dropped. What do you check? | Deliverability first (SPF/DKIM/DMARC, bounce and spam rates), then list quality, then copy, then timing. |
| How do you keep AI costs under control? | Reference tables and lookups, cheap models for classification, one job per prompt, test small, formulas for scoring. |
| How do you know a PQL or health score works? | Back-test it: did high scores convert or renew more than low scores last quarter? |
| Marketing and sales disagree on lead quality. What do you do? | Agree a written MQL/SQL definition, measure conversion by source, review together monthly. |
| What would you do in your first month? | Listen and map the stack and funnel, fix one painful data problem, ship one quick win. |
Typical take-home tasks
- Build a Clay table of 50 target accounts with signals and drafted first lines.
- Design a lead-routing flow for inbound demo requests.
- Analyse a sample CRM export and recommend where the funnel leaks.
- Write a teardown of the company's own pricing or onboarding.
Treat each one like a client project: a short README, a Loom walkthrough, your assumptions written down, and one thing you would do next.
How to get paid: three routes
There are three ways this skill set turns into income, and they are not mutually exclusive.
| Route | What it looks like | What gets you in |
|---|---|---|
| A job | Companies and agencies hire GTM engineers to build and run these systems. | Proof you've built something — a working system in a short video, not a resume or a slide deck of theory. |
| Clients | You sell the system directly to companies, often starting with a small proof: for example, offering a prospect a few hundred ICP-fit accounts from their own segment, ranked by fit, before they pay you anything. | The free list or sample proves you can do the work before anyone pays for it; from there you offer to run a campaign on it. |
| In-house | You build the motion inside your own company's GTM function. | Three checks before it's worth it: a deal worth $10K+ a year, 50,000+ contacts in the addressable market, and a sales process ready to take the resulting meetings. |
Across all three routes, the technical skill of building the system is becoming more common; the marketing judgement — which segment to pick, what offer to lead with, how to read a campaign's numbers (Stage 5) — stays comparatively rare, and is what each route above actually pays for.
Build your portfolio: a 90-day plan through the 7 levels
This plan builds Stages 3 and 4's seven-level outbound system end to end, with a real artefact at every level, before you apply anywhere. It is a different 90 days from the "first 90 days in the job" table below: this one is for building proof you don't yet have; that one is for once you're hired.
| Days | Levels | Weekly focus |
|---|---|---|
| 1–30 | Strategy, infrastructure, lists (Stage 3, §3.2–3.4) | Wk1: run the strategy chain on a real company and fix every output by hand. Wk2: buy domains and inboxes, start the 14-day warmup. Wk3: build one list from a database and one in Clay. Wk4: build one list from Google Maps or a directory, then compare all three on cost and accuracy. |
| 31–60 | Offers, copy, testing (Stage 5, §4.1–4.3) | Wk5: write three offers and three emails (Lab 5.3). Wk6: launch at 5 cold emails per inbox per day, ramping to 15. Wk7: track contacts per lead for every offer (Lab 5.5). Wk8: kill anything above 1,000–2,000 CPL and scale the winner into a second segment. |
| 61–90 | Replies and agents (Stage 5, §4.5–4.6) | Wk9: build reply routing into a messaging channel. Wk10: set up the pre-call workflow and call every positive reply. Wk11: write your first skill and connect an agent to your tools. Wk12: rebuild your Week 3–4 list with the agent and compare cost and quality against the hand-built version. |
At day 90 you have: a strategy document you wrote and corrected; warmed infrastructure you set up yourself; three lists built three different ways, compared on cost and accuracy; at least one tested offer with a real contacts-per-lead number; a working reply-routing system; and an agent running your own written skill. That is a complete, numbered portfolio for any of the three routes above — and it is the same system companies pay to have built for them.
Your first 90 days in the job
| Days | Focus | Deliverable |
|---|---|---|
| 1–30 | Learn: meet sales, marketing, CS and RevOps; map the stack and the funnel | A one-page "how we go to market today" map and a list of the top 5 pains |
| 31–60 | Fix: solve the most painful data or routing problem | One shipped system (for example a signal alert or a clean CRM sync) with a before/after number |
| 61–90 | Build: start a bigger engine | A scoring model, an outbound engine or a health score, with a written plan for the next quarter |
Keep learning
- Clay University: official Clay courses.
- GTM University (gtmu.io): Christian's outbound-engineering course and community; the source for Stages 3–4's Level 1–7 framework, inbox math and contacts-per-lead benchmarks.
- dbt documentation: data modelling (Stage 1).
- SQLBolt: free interactive SQL lessons.
- Stripe docs: billing and metering (Stage 6).
- Newsletters: Growth Unhinged (Kyle Poyar) on pricing and PLG; Lenny's Newsletter on product and growth.
- Communities: Clay's Slack community and RevGenius, for questions, job posts and feedback on your builds.
Checklist
Reference
Glossary
Every term in the manual, in plain English. Type to filter.
No term matches that search.