Skip to main content
TRACKLAYER · AUDIENCES AI

Define audiences in plain English.
Sync to every ad platform.

Type a cohort the way you’d describe it to a junior analyst — “high-LTV repeat buyers from California who lapsed in last 60 days” — and TrackLayer compiles it into a typed AudienceFilter, dry-runs an estimate, and syncs to Meta, Google, TikTok, and Klaviyo with hashed identifiers per platform spec.
FROM INTENT
high-LTV repeat buyers from California who lapsed in last 60 days
Same input across the dashboard, the MCP tool, the Slack bot, and the API. One source of truth for what “VIP” means at your company.
// AUDIENCES_AI · COMPILE
describe
high-LTV repeat buyers from California
who lapsed in last 60 days
anthropic · strict json schema · 1.4s
{
  "suggested_name": "CA Lapsed VIP · 60d",
  "estimated_user_count": 1247,
  "event_filter": {
    "all": [
      { "event": "purchase", "count_gte": 3,
        "window_days": 365 },
      { "geo.region": "US-CA" },
      { "ltv_usd_gte": 850 },
      { "no_event": "purchase",
        "window_days": 60 }
    ]
  },
  "platforms": ["meta","google","tiktok","klaviyo"]
}
metagoogletiktokklaviyo
// THE PROBLEM

Why does building a 'lapsed VIP' audience take 3 SQL queries and a 60-minute meeting?

The shape of the gap

Every growth team has the same loop: marketing asks for a cohort, analyst writes Postgres / dbt / Looker SQL, ops re-pulls hashed identifiers, someone uploads to Meta, someone else mirrors into Klaviyo. Four tools, three hand-offs, two days. The audience definition lives in a Slack message; the implementation lives in four places.

The cost of the gap

Win-back campaigns lag by 2-3 weeks. Audience definitions drift between platforms (Klaviyo's 'lapsed' isn't Meta's 'lapsed'). Identifier hashing gets done wrong on at least one platform. And every cohort change is another SQL ticket — so teams stop iterating.

Why retention matters

Most cohort definitions are time-windowed: 'lapsed 60d', 'high-LTV 365d', 'YoY repeat buyers'. If your warm event store has 30-day retention (Lite) or 90-day (Starter), 'lapsed 180d' literally cannot be expressed. Scale's 365-day retention is the floor for a working audience system. Pro's 2-year retention is the floor for YoY churn-prediction baselines.

§ 01

Anthropic strict-JSON gives you exact filters.

The compiler is one Claude call with a Zod-derived JSON schema as the only allowed output. No prose, no hallucinated fields, no 'almost-valid' filters that crash the sync worker.
01
You describe the audience
Plain English in the dashboard input. Same syntax in the MCP tool, the Slack bot, or the API. No SQL, no JSONata, no dbt model.
02
Anthropic compiles to AudienceFilter
workers/api/src/ai/audience-compiler.ts hits Claude with a strict JSON schema. Output is a typed AudienceFilter — event_filter, suggested_name, estimated_user_count. No free-form text, no hallucinated fields.
03
Dry-run estimates the cohort
Filter runs against your warm event store first (365-day retention on Scale, 2y on Pro). You see estimated_user_count plus 25 sample profiles before you commit. Cheap to throw away wrong intent.
04
Confirm + sync to ad platforms
POST to /audiences inserts the row in audiences and queues per-platform sync via workers/cron/src/audiences-sync.ts. Status surfaces in audience_platform_syncs.
// SCHEMA · audience-compiler.ts
// workers/api/src/ai/audience-compiler.ts
const AudienceFilter = z.object({
  suggested_name: z.string().max(64),
  estimated_user_count: z.number().int(),
  event_filter: z.object({
    all: z.array(EventClause).min(1),
  }),
  platforms: z.array(
    z.enum(["meta","google","tiktok","klaviyo"])
  ).min(1),
});

await anthropic.messages.create({
  model: "claude-opus-4",
  tools: [{
    name: "compile_audience",
    input_schema: zodToJsonSchema(AudienceFilter),
  }],
  tool_choice: { type: "tool", name: "compile_audience" },
  messages: [{ role: "user", content: nlDescription }],
});
§ 02

One audience, four platforms, hashed identifiers.

workers/cron/src/audiences-sync.ts fan-outs the AudienceFilter to each ad-platform API. Identifier types and hashing follow each vendor's spec — no shortcuts, no shared code that 'works for Meta and we'll fix Google later'.
§ 01

Meta Custom Audiences

POST /v18.0/act_<acct>/customaudiences

Sends batches keyed on email_sha256, phone_sha256, fbp, external_id. SHA-256 lowercased per Meta hashing spec. CUSTOM source, 30-day retention attribute.

§ 02

Google Customer Match

customers/<id>/userLists:mutate

OfflineUserDataJob with hashedEmail, hashedPhoneNumber, hashedFirstName + hashedLastName + countryCode + postalCode. Crm-based user list, upload + close in one job.

§ 03

TikTok Audience

POST /open_api/v1.3/dmp/custom_audience/create/

EMAIL_SHA256, PHONE_SHA256, IDFA_SHA256, GAID_SHA256. file_paths upload via TT MMP, then create custom audience referencing the file id. EU residency respected.

§ 04

Klaviyo Profiles

POST /api/profile-bulk-import-jobs

Profile attributes only (Klaviyo dedupes on raw email). External_id mirrored into custom property. Adds the audience as a Klaviyo segment via segment-create on first sync.

§ 03

What it looks like in TrackLayer.

Three panels of the /audiences page. Real merchant names from the staging tenant — Glass House Coffee, Linden Skin, North Loop Apparel — picked because their cohort definitions exercise the corners of the compiler.
// A · INPUT
describe an audience…
examples
Glass House: lapsed espresso subscribers 45d
Linden Skin: serum-only buyers, no kit yet
North Loop: returners ≥2 within 90d
// B · DRY-RUN
1,247
ESTIMATED USERS · ±3.2%
sample (3 of 25)
a***@gmail.com · CA · LTV $1,420
m***@yahoo.com · CA · LTV $890
j***@me.com · CA · LTV $2,310
// C · SYNC STATUS
metasynced2 min ago
googlesynced2 min ago
tiktokuploadingnow
klaviyosynced2 min ago
// HOW IT COMPARES

What other audience tools actually do.

Four products people consider in this category. Cross-checked against vendor docs, April 2026.
CAPABILITYTRACKLAYERKlaviyoSegmentTripleWhale
Natural-language audience definition~
Multi-platform sync (Meta + Google + TikTok + Klaviyo)
Dry-run preview before sync (count + sample)~
Per-platform identifier hashing per spec~
Scheduled refresh (4h-15min cadence)~
365-day+ event retention for cohort math
Strict-JSON LLM output (no hallucinated filters)
TRACKLAYER
Natural-language audience definition
Multi-platform sync (Meta + Google + TikTok + Klaviyo)
Dry-run preview before sync (count + sample)
Per-platform identifier hashing per spec
Scheduled refresh (4h-15min cadence)
365-day+ event retention for cohort math
Strict-JSON LLM output (no hallucinated filters)
Klaviyo
Natural-language audience definition
Multi-platform sync (Meta + Google + TikTok + Klaviyo)
Dry-run preview before sync (count + sample)
~
Per-platform identifier hashing per spec
~
Scheduled refresh (4h-15min cadence)
365-day+ event retention for cohort math
Strict-JSON LLM output (no hallucinated filters)
Segment
Natural-language audience definition
Multi-platform sync (Meta + Google + TikTok + Klaviyo)
Dry-run preview before sync (count + sample)
Per-platform identifier hashing per spec
Scheduled refresh (4h-15min cadence)
~
365-day+ event retention for cohort math
Strict-JSON LLM output (no hallucinated filters)
TripleWhale
Natural-language audience definition
~
Multi-platform sync (Meta + Google + TikTok + Klaviyo)
Dry-run preview before sync (count + sample)
Per-platform identifier hashing per spec
Scheduled refresh (4h-15min cadence)
365-day+ event retention for cohort math
Strict-JSON LLM output (no hallucinated filters)
§ 04

Three cohorts that earn back the price of Scale.

Each one needs the 365-day retention floor that Scale ($249/mo) provides. On Lite (30d) or Starter (90d), the lookback exceeds your retention and the compiler refuses to commit the filter.
§ 01

Win-back lapsed customers (180d)

Define: purchased ≥1 in last 365d AND no purchase in last 180d. Sync to Meta + Klaviyo. Needs 365-day retention to look back far enough — Scale tier covers it. On Lite (30d) or Starter (90d) the cohort definition can't even compile because the lookback exceeds your retention window.

§ 02

High-LTV VIP exclusion list

Define: ltv_usd ≥ 1000 AND purchases ≥ 5 within 365d. Sync as exclusion to Meta and Google ads to stop wasting acquisition budget on existing repeat buyers. Estimated count surfaces in dashboard before sync — no platform call until you confirm.

§ 03

Cart-abandon high-intent (7d, ≥$200)

Define: add_to_cart in last 7d AND no purchase since AND cart_value_usd ≥ 200 AND viewed_product_count ≥ 4. Sync to Meta CAPI as audience and Klaviyo as flow trigger. Refreshes every 6h via the cron worker.

// AVAILABLE ON

Scale and Pro.

SCALE
$249/mo
50 compilations/mo
365-day retention · 4h refresh · 12M events/mo
PRO
$599/mo
Unlimited compilations
2-year retention · 15min refresh · 50M events/mo · multi-store
ENTERPRISE
Custom
Unlimited compilations
Dedicated MCP · custom retention · SOC2 + DPA · named AM
Audiences AI compilation needs 365-day retention to define LTV / lapsed / win-back cohorts — that’s the floor. Scale ($249/mo) gives you 50 compilations/mo, which covers most growth teams iterating weekly. Pro ($599/mo) is unlimited and adds 2-year retention plus multi-store workspace.
NEXT

Stop writing SQL for audiences.
Start writing English.

Scale starts at $249/mo with 50 audience compilations included. 14-day no-questions refund. Cancel anytime.
Start free trial →BOOK A DEMO

We use essential cookies to keep the site secure and functional. Analytics and third-party tags run only with your consent. See our Cookie Policy.

We use essential cookies to keep the site secure and functional. Analytics and third-party tags run only with your consent. See our Cookie Policy.