Event API
POSTOverview
Section titled “Overview”The Events API accepts structured JSON events that describe what users see, click, and buy. It is the right choice when you need to send analytics from a backend, mobile app, native application, or a custom frontend that should not rely on the browser collector.
Luigi’s Box currently supports these event patterns in v1:
- Page and detail views via
pv - Search, autocomplete, listing, and recommendation impressions via
event - Clicks and micro-conversions via
click - Completed purchases via
transaction
Use the Events API when:
- You are integrating Luigi’s Box in a mobile application
- You need server-side control over event delivery
- You want to send analytics from a custom frontend implementation
Event envelope
Section titled “Event envelope”Every event shares the same top-level envelope. The event type determines which additional payload keys are required.
Common parameters
Section titled “Common parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
type | String | ✓ | Event type such as pv, event, click, or transaction. |
tracker_id | String | ✓ | Your Luigi’s Box tracker ID. |
client_id | String or Integer | ✓ | Stable anonymous identifier for the current browser, device, or app install. |
id | String | ✓ | Globally unique identifier for this event. A UUID is recommended. |
customer_id | String or Integer | Your logged-in user identifier. Send it together with client_id when available. | |
local_timestamp | Integer | UNIX timestamp in seconds. Do not send milliseconds. | |
platform | String or Array | Platform identifier such as iOS, Android, or desktop. You can also send [platform, version]. | |
user_agent | String | Browser or app user agent string. | |
referer | String | Previous page URL if available. | |
context | Object | Context values that match your indexed catalog context, for example warehouse or market. | |
ab_test_variant | String | Session-level A/B variant name such as Original or Luigis. | |
consent_granted | Boolean | Set true when the user granted consent for personalization. | |
recommendation_id | String | Recommendation batch identifier used mainly for email/newsletter attribution. |
Identity rules
Section titled “Identity rules”- Keep
client_idstable for the same browser or device, even if the user logs in or logs out. - Add
customer_idonly when the user is authenticated. - Use the same product or object identity here as in your indexing data. See Object identity.
Impression events
Section titled “Impression events”Use pv to report page views and detail views.
- For a catalog detail page, send the indexed object identity in
url - For a generic page view, send the canonical page URL or path in
url
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
type | String | ✓ | Must be pv. |
url | String | ✓ | Object identity for a catalog detail page, or canonical page URL/path for a generic page view. |
title | String | Human-readable page or object title for analytics presentation. |
This event is the foundation of journey tracking. It tells Luigi’s Box what the user viewed before they searched, clicked, converted, or purchased.
Search events
Section titled “Search events”Report full-text search interactions with a list event whose key is exactly Search Results.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
type | String | ✓ | Must be event. |
lists | Object | ✓ | Container for the reported lists. |
lists["Search Results"] | Object | ✓ | The search results list. The list name is case-sensitive. |
lists["Search Results"].query.string | String | ✓ | The exact user query. |
lists["Search Results"].query.filters | Object | Active search filters, sort values, _Guid, and _Variant. | |
lists["Search Results"].items | Array | ✓ | The visible search results returned to the user. |
Search result item fields
Section titled “Search result item fields”| Field | Type | Required | Description |
|---|---|---|---|
title | String | ✓ | Display title of the result. |
type | String | ✓ | Catalog object type such as item, category, or article. |
url | String | ✓ | Indexed object identity. |
position | Integer | ✓ | Absolute position in the full result set. Keep it cumulative across pagination. |
price | Float | Displayed price if relevant. |
Search-specific filters
Section titled “Search-specific filters”- Use
_Guidto send theguidfrom the Search API response - Use
_Variantto report the list-level A/B variant - Include active filter and sort values exactly as the user sees them
Autocomplete events
Section titled “Autocomplete events”Use event with a list named exactly Autocomplete to report what the user saw in the autocomplete dropdown.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
type | String | ✓ | Must be event. |
lists.Autocomplete.query.string | String | ✓ | The text currently typed by the user. |
lists.Autocomplete.query.filters | Object | Optional filters. Include _Guid when the autocomplete response provides one. | |
lists.Autocomplete.items | Array | ✓ | Suggestions shown to the user. |
Item fields
Section titled “Item fields”Autocomplete items use the same core fields as search results:
titletypeurlposition- optional
price
If your empty-state autocomplete shows Top Items on focus, do not track it as Autocomplete. Track it as a Recommendation event and set both Recommender and RecommenderClientId to autocomplete_popup.
Product listing events
Section titled “Product listing events”Use event with a list named exactly Product Listing to report category pages, brand pages, campaign landing pages, or other browse-first listing experiences.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
lists["Product Listing"].items | Array | ✓ | Visible products in the listing. |
lists["Product Listing"].query.filters | Object | Active filters, sorting, _Guid, and _Variant. | |
lists["Product Listing"].query.scopes | Object | ✓ | Listing context such as category or brand. |
Scope keys
Section titled “Scope keys”- For categories, send
_category_labeland_category_identity - For brands, send
_brand_labeland_brand_identity
As with search, positions must be absolute across paginated results.
Recommendation events
Section titled “Recommendation events”Use event with a list named exactly Recommendation whenever a recommendation widget is shown.
Required filters
Section titled “Required filters”| Filter key | Required | Description |
|---|---|---|
RecommenderClientId | ✓ | Stable identifier of the recommender placement, such as homepage_top or item_detail_alternatives. |
RecommendationId | Strongly recommended | Unique identifier of the returned recommendation set. Required for all new integrations. |
ItemIds | Input item identities used to generate the recommendation. | |
Recommender | Luigi’s Box recommender name from the response. | |
Type | Recommendation type from the response. | |
_Variant | A/B test variant for this list. |
Why RecommendationId matters
Section titled “Why RecommendationId matters”RecommendationId allows Luigi’s Box to attribute later clicks and purchases to the exact recommendation set that generated them. For new integrations, treat it as mandatory.
Click events
Section titled “Click events”Send a click event whenever a user clicks a search result, autocomplete suggestion, or recommendation.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
type | String | ✓ | Must be click. |
action.type | String | ✓ | Must be click. |
action.resource_identifier | String | ✓ | Identity of the clicked object. If the clicked result is of type query, send its title instead. |
Luigi’s Box uses resource_identifier to attribute the click to previously reported lists.
Conversion events
Section titled “Conversion events”Micro-conversions use the same outer event type as clicks.
- Keep
typeset toclick - Use an
action.typeother thanclick, such asadd-to-cart,add-to-wishlist, orbuy - Set
action.resource_identifierto the same object identity used in your catalog and list events
Send conversion events from every place where the action can happen, including list pages and detail pages. Luigi’s Box scans the earlier event stream backwards to attribute the conversion to prior search, autocomplete, product listing, or recommendation impressions.
Transaction events
Section titled “Transaction events”Use transaction to report completed purchases.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
type | String | ✓ | Must be transaction. |
items | Array | ✓ | All purchased line items in the order. |
Transaction item fields
Section titled “Transaction item fields”| Field | Type | Required | Description |
|---|---|---|---|
url | String | ✓ | Indexed identity of the purchased object. |
count | Integer | ✓ | Quantity purchased. |
total_price | Float | ✓ | Final line-item price after quantity and discounts are applied. |
title | String | Human-readable title for reporting. | |
was_discounted | Boolean | Set true when the line item was discounted below the catalog price. | |
was_volume_discounted | Boolean | Set true when a quantity-based discount was applied. |
Include every purchased item in the order, not only the ones previously touched by Luigi’s Box lists. Luigi’s Box handles attribution after ingesting the transaction.
Error handling and limits
Section titled “Error handling and limits”Common responses
Section titled “Common responses”| HTTP status | Meaning |
|---|---|
400 Bad Request | Invalid JSON or invalid event structure. |
413 Payload Too Large | Request is too large. Reduce payload size or enable compression. |
429 Too Many Requests | Rate limit exceeded. Respect Retry-After and retry later. |
Limits
Section titled “Limits”- Maximum 30 events per 15 seconds for a given
client_id - Maximum 400 events per session
- Sessions expire after 30 minutes of inactivity
If you exceed the rate limits, Luigi’s Box returns 429 Too Many Requests.
Was this page helpful?
Thanks.