# Measure cart-to-purchase drop-off

> Map three verified ecommerce events, run the canonical ordered funnel, and separate measured checkout loss from hypotheses about payment, shipping, or UX.

## Agent adaptation contract

- Canonical human page: https://agentry.sh/workflows/cart-abandonment-funnel
- Execution mode: on_demand
- Immutable automation template: none
- Applies to: ecommerce
- Required example events: add_to_cart, checkout_started, order_completed
- Required Agentry resources: signal_map, onboarding_state, query_blueprints
- Do not use when:
  - Do not use guessed ecommerce event names or interpret missing events as shopper abandonment.
  - Do not claim time-on-step, revenue loss, causes, or industry benchmarks from the three-count funnel blueprint.
  - Do not mix anonymous and known shopper identities without a verified identity-linking strategy.
- Ask before using:
  - Which observed events represent add-to-cart, checkout start, and completed order in that exact order?
  - Which stable shopper identity joins guest and signed-in steps without double counting?
  - What exact lookback, storefront, device population, and exclusions should be applied?

This is an adaptable workflow example, not an API recipe. Map event and property names to the project's saved signal map, require status: "verified" from GET /v1/projects/:project_id/onboarding, and confirm the required signals through live event/property metadata and rows. Fetch current OpenAPI or query-blueprint details before making calls. Do not infer unattended authority from this page.

## Why this matters

A cart funnel shows where measured progression stops; it does not explain why.
Payment failures, shipping cost, inventory, slow pages, identity changes, and
simple intent can all produce similar drop-off.

The `funnel_3_step` blueprint answers the narrow ordered question reliably. Use
separate evidence to investigate causes after the largest measured loss is
known.

## What you get

- Three approved, observed ecommerce events
- Ordered shopper counts for the selected lookback
- Step and overall conversion calculated from canonical counts
- Identity and instrumentation caveats plus a ranked follow-up plan

## Walk through it

**You:**
> Where do shoppers drop between cart and completed order?

**Agent:**
> I will verify the storefront's exact event names and identity continuity before
> running the three-step funnel.

```http
GET /v1/projects/:project_id/signal-map
GET /v1/projects/:project_id/onboarding
# Require status: "verified"; use live event/property reads for the selected signals.
GET /v1/projects/:project_id/event-names
GET /v1/query-blueprints/funnel_3_step
```

```json
{
  "server_emitted": [],
  "analytics_events": [
    { "event": "cart_item_added", "count": 21400, "last_seen": 1783651200 },
    { "event": "checkout_started", "count": 8800, "last_seen": 1783651210 },
    { "event": "order_completed", "count": 4200, "last_seen": 1783651250 }
  ],
  "wildcards": []
}
```

```http
POST /v1/projects/:project_id/query-blueprints/funnel_3_step/run
```

```text
Params:
  step1: cart_item_added
  step2: checkout_started
  step3: order_completed
  days: 30
```

```json
{
  "rows": [
    { "step1_count": 21400, "step2_count": 8800, "step3_count": 4200 }
  ]
}
```

The measured conversions are 41.1% from cart to checkout, 47.7% from checkout
to order, and 19.6% overall. Those calculations do not include time-on-step,
cart value, payment failure, or a benchmark.

## The output

```text
Cart-to-purchase funnel — last 30 days

cart_item_added       21,400  100.0%
checkout_started       8,800   41.1%  drop: 58.9%
order_completed        4,200   19.6%  step conversion: 47.7%

Evidence gaps
- <identity, sampling, delayed server confirmation, missing device property>

Follow-up hypotheses
- payment failures → inspect verified payment-failure signal
- slow checkout → inspect measured completion duration
- payment-method differences → run the dedicated comparison
```

## Setting it up

Send browser actions with the public browser credential and server-confirmed
orders with the trusted server credential. Use a stable first-party shopper ID
and a verified transition when the shopper signs in. Never treat a client-side
“purchase clicked” event as a completed order.

Include only necessary properties such as SKU or storefront. Keep payment data,
addresses, tokens, and cart contents outside analytics.

## Variations

- *"Segment the same funnel by an observed device property."*
- *"Compare two exact adjacent periods with the same frozen event mapping."*
- *"Measure product-view to add-to-cart separately using a suitable approved query."*
- *"Tell me which missing event prevents a trustworthy funnel."*
