Log an attribution event
Request parameters
The event type. See the event types table below for valid values.
Your store domain. Example:
"yourstore.com"A session identifier from your system — typically your checkout ID or order ID.
The protocol that initiated the session:
"ucp" or "acp".The specific AI surface that triggered this event, if known. Examples:
"google_ai_mode", "chatgpt", "perplexity".Additional event data. Common fields:
product_id— the product involvedvariant_id— the specific variant selectedvalue— order value in smallest currency unit (cents or paise)currency— ISO 4217 currency code
ISO 8601 timestamp. Defaults to the current time if omitted.
Event types
| Event | When to fire |
|---|---|
ai_checkout_initiated | UCP or ACP checkout session created |
ai_checkout_completed | Order confirmed and paid |
ai_checkout_failed | Checkout failed — payment declined or out of stock |
ai_product_viewed | Product viewed via AI surface (when detectable server-side) |
Response fields
Unique identifier for this logged event.
Confirmation that the event was recorded. Value is always
"recorded" on success.Whether Asva was able to classify the session to a specific AI surface.
The AI surface Asva attributed this session to, based on your
ai_surface field and its own signal analysis.Attribution confidence score from 0 to 1. Values above 0.8 are high-confidence classifications.
Integration examples
Add attribution logging to your UCP and ACP checkout handlers. Always fire asynchronously — do notawait the Asva call:
Pull attribution data
Query parameters
Domain to query. Example:
"yourstore.com"Start date in ISO 8601 date format. Example:
"2026-03-01"End date in ISO 8601 date format. Example:
"2026-04-01"Time granularity for the
daily array: "day" (default), "week", or "month".Response fields
The domain queried.
The date range of the report, with
start and end fields.Aggregated metrics for the full period.
Total sessions attributed to an AI surface.
Total checkout sessions initiated from an AI surface.
Total orders completed from an AI surface.
Total revenue from AI-attributed orders, in smallest currency unit.
Orders divided by sessions, as a decimal.
0.131 = 13.1%.Average order value from AI-attributed orders, in smallest currency unit.
Sessions and orders broken down by AI surface. Keys include
google_ai_mode, chatgpt, perplexity, and other_ai.Day-by-day (or week/month) breakdown with
date, sessions, checkouts, orders, and revenue_cents per period.Code examples
Related
- Dark Traffic Detection — how Asva identifies AI sessions
- GA4 Integration — connect attribution data to your GA4 reports
- Attribution Model — how confidence scoring works