Skip to main content
TRACKLAYER · EVENT TAXONOMY

Catch the schema regression before
Meta optimization tanks.

Every six hours, TrackLayer recomputes the canonical shape of every event you fire — top-level keys, nested types, one level deep. When the shape moves on three or more events, you get a diff, a severity, and the exact percentage of payloads that lost the field.
SYMPTOM · WHAT THE INBOX SEES
  • Meta CPA up 31% over four days, no ad changes
  • EMQ score on purchase drifted from 8.4 to 6.1
  • Klaviyo flow targeting user_data.email stopped firing
  • Google Ads optimization regressing despite stable spend

No alert ever fired. The events kept shipping. Just one field, missing from 47% of payloads since the Tuesday afternoon theme deploy.

$ tracklayer drift inspect purchase --since 2026-04-23
// canonical schema · v17 · merchant_id=glasshouse
event_name: purchase
drift_detected_at: 2026-04-23 14:08 UTC
severity: critical
─── shape diff vs canonical ───
+ items.0.product_id (string · added in 100% of events)
+ custom_data.shipping_tier (string · added in 92%)
user_data.phone (removed in 47% of events since 2026-04-23)
~ custom_data.value (number → string in 12% of events)
suggestion: Field user_data.phone disappeared from 47% of events since 2026-04-23. Check the Shopify theme push at 14:02 UTC and the CAPI gateway redeploy at 14:05 UTC. EMQ score dropped 2.3 points in the same window.
// THE PROBLEM

Why did your Meta CPA spike 30% three days after the last release?

Schema drift is the failure mode nobody alerts on. A frontend engineer drops phone from the checkout payload — for a perfectly defensible PII reason — but never tells the growth team. CAPI keeps firing. Events keep landing. The HTTP 200s look identical to the ones from last week.

Inside Meta, the EMQ score quietly slides from 8.4 to 6.1. The optimization algorithm sees fewer matches, decides your audience is harder to convert, and widens reach. CPA climbs. Everyone blames the creative.

By the time someone notices — usually a weekly performance review with finance pulling backend revenue alongside the Meta dashboard — the learning phase has absorbed three weeks of degraded signal. Resetting it costs roughly four to six weeks of CPA inflation per channel.

The fix is not better ad creative. The fix is a system that knows what your events are supposed to look like, notices when the shape moves, and tells you while there is still a deploy log open.

§ 01

Canonical schema per merchant × event.

The detector runs as a Cloudflare cron every six hours. No agent. No instrumentation. It reads the events you already fire.
§ 01
Sample the last 5,000 events
Per (merchant_id, event_name). Newer events weighted heavier so dead taxonomy ages out.
§ 02
Compute the canonical shape
Top-level keys + types, recursive one level deep. Arrays sampled to detect homogeneity. Output: a JSONB shape descriptor.
§ 03
Diff against the prior version
If three or more events match a different shape than canonical, open a new event_taxonomy_versions row with the diff in event_taxonomy_drifts.
§ 04
Classify severity
currency, value, event_id missing → critical. items, user_data.email missing → warning. New optional field → info.
§ 05
Hand off to the alert engine
Insert into the alert engine with rule type schema_drift. Slack and email fire on critical. Daily digest for warnings.
// event_taxonomy_drifts.diff · jsonb
{
  "version_from": 16,
  "version_to":   17,
  "event_count": 4827, "drifted_count": 2271,
  "removed": [
    { "path": "user_data.phone", "pct": 0.47 },
  ],
  "added": [
    { "path": "items.0.product_id", "type": "string" },
  ],
  "type_changes": [
    { "path": "custom_data.value", "from": "number", "to": "string" }
  ],
  "severity": "critical"
}
§ 02

Three severities, three actions.

The classifier is deterministic. It maps the diffed paths against a known list of conversion-critical fields, then routes the alert accordingly.
§ CRITICAL
Slack + email immediately.
If currency or value disappears from a purchase event, Meta's optimization signal is broken. We page within sixty seconds of the cron run that detected it. No batching, no digest.
TRIGGERS ON
currencyvalueevent_idevent_name
§ WARNING
Daily summary at 09:00 UTC.
Match-quality fields. Their absence will degrade EMQ over days, not seconds. Bundled into the morning summary so growth can review without context-switching.
TRIGGERS ON
itemsuser_data.emailuser_data.phonefbcfbp
§ INFO
Logged to /schemas. No alert.
New optional fields, additions to nested objects, or types that became more permissive. Useful as a release record but not worth a notification.
TRIGGERS ON
custom_data.*new optional fields
§ 03

What it looks like in TrackLayer.

Three surfaces: the version list, the diff detail, and the alert configuration. Every drift links back to the events that triggered it.
/schemas — taxonomy versions · 7d47 versions · 12 drifts · 3 critical
EventVersionDetectedSeverityChange
purchasev172026-04-23 14:08CRITICALuser_data.phone removed in 47% of events
add_to_cartv92026-04-22 09:34WARNINGuser_data.email missing in 12% of events
view_contentv222026-04-21 16:51INFO+ custom_data.collection_handle (added)
initiate_checkoutv112026-04-20 03:14CRITICALcurrency type changed: string → undefined in 8%
leadv62026-04-19 22:07INFO+ custom_data.lead_source (added in 100%)
drift · purchase · v16 → v17● critical · 2271 / 4827 events
─── canonical · v16 ──────────────── current · v17 ─────────────
  event_name: "purchase"
  event_id: string
  custom_data:
    currency: "USD"
~     value: number // 12% sending string
  user_data:
    email: hashed_string
    phone: hashed_string // missing in 47%
+   items: array<{ product_id: string }> // added in 100%
▸ suggestion: Field user_data.phone disappeared from 47% of
  events since 2026-04-23. Correlated with deploy
  sha=8a2f1c · "reduce PII in checkout payload".
alerts · schema_drift rule● enabled
Severity thresholdcritical
Slack webhookhooks.slack.com/services/T0***/B0***
Slack channel#growth-alerts
Email recipientsgrowth@glasshouse.co
Cooldown30 minutes per event_name
Suppress duringBFCM window · 2026-11-25 → 2026-12-02
Last fired2026-04-23 14:09 UTC · acked
// HOW IT COMPARES

Stape ships pixels. Segment ships warehouses. We ship the contract.

Most server-side stacks accept whatever payload your frontend hands them. We diff it against what it used to be.
CapabilityTrackLayerStapeSegment
Per-merchant × per-event canonical schema~
Automatic drift detection (no rule writing)
Severity classification by field criticality
Suggestion text correlated with deploy log
Native integration with alert engine (Slack, email)~~
Schema versioning with full diff history
Type-change detection (number → string)~
TrackLayer
Per-merchant × per-event canonical schema
Automatic drift detection (no rule writing)
Severity classification by field criticality
Suggestion text correlated with deploy log
Native integration with alert engine (Slack, email)
Schema versioning with full diff history
Type-change detection (number → string)
Stape
Per-merchant × per-event canonical schema
Automatic drift detection (no rule writing)
Severity classification by field criticality
Suggestion text correlated with deploy log
Native integration with alert engine (Slack, email)
~
Schema versioning with full diff history
Type-change detection (number → string)
Segment
Per-merchant × per-event canonical schema
~
Automatic drift detection (no rule writing)
Severity classification by field criticality
Suggestion text correlated with deploy log
Native integration with alert engine (Slack, email)
~
Schema versioning with full diff history
Type-change detection (number → string)
~
§ 04

Three drifts we caught last week.

Anonymized from real merchant detections — Pro tier customers, April 2026.
CASE 01
DTC · home goods · ~$8M ARR
event: purchase
WHAT BROKE

Shopify theme update inlined a new currency formatter that returned the string "USD 129.00" instead of the number 129.

HOW WE FOUND IT

Type change on custom_data.value: number → string in 100% of events. Critical alert at 14:08 UTC, 6 minutes after the deploy.

OUTCOME

Theme reverted in 18 minutes. Meta optimization spared ~$11K of bad-signal spend. EMQ rebounded to 8.2 within 36 hours.

CASE 02
B2B SaaS · vertical CRM · $4.2M ARR
event: lead
WHAT BROKE

A backend migration renamed external_id to user_id silently — the old contract was kept for two weeks then removed.

HOW WE FOUND IT

Removal of external_id in 100% of events. Critical alert fired the same day as the cleanup PR merged.

OUTCOME

Klaviyo flow targeting external_id stopped firing for 9 hours instead of 9 days. Field aliased back, audience sync restored, no lost trial-to-paid emails.

CASE 03
Agency · 14 e-com clients · ~$200M GMV
event: purchase + add_to_cart
WHAT BROKE

Agency-wide PII reduction policy stripped user_data.email and user_data.phone from all clients in one rollout.

HOW WE FOUND IT

Warning fired across all 14 clients within the same 6-hour window. Daily digest grouped them into one report.

OUTCOME

Hashed-email pipeline configured before EMQ degraded. Match quality held at 7.9 average instead of falling to ~5. Three weeks of CPA inflation avoided across the portfolio.

// AVAILABLE ON

Pro and Enterprise.

Schema Drift detection is part of the Pro tier ML moat ($599/mo). Detection runs every 6 hours on every event_name you fire. Alerts integrate with Slack and email; Enterprise adds PagerDuty, Opsgenie, and a private webhook with HMAC signing.
PRO · $599/moENTERPRISE · custom
§ A

6-hour detection cycle

Cron at :00 every six hours. Most drifts caught within one cycle of the deploy that caused them.

§ B

Slack + email built in

Webhook URL and recipient list configured per workspace. No middleware, no Zapier.

§ C

Suppression windows

BFCM and product launches mark the window — info and warning drifts queue, critical still fires.

§ D

Full version history

Every canonical schema is versioned in event_taxonomy_versions. Roll back, audit, replay.

NEXT

Stop the schema drift before it costs you
a quarter of CPA.

14-day free trial on the Pro plan. Schema drift detection runs from your first event. No credit card. No agent install.
Start free trial →BOOK A DEMO
PRO · $599/MO · 14-DAY TRIAL · NO CC · CANCEL ANYTIME

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.