---
title: Shopping Assistant analytics
description: Understand what Shopping Assistant tracks automatically and which product outcome events your integration still needs to send.
slug: shopping-assistant/guides/analytics
docKind: guide
hub: shopping-assistant
---

Luigi's Box records the assistant flow automatically from your API calls — which questions are shown, which options shoppers select, and which products are returned (the Assistant Listing event). What it cannot see is what happens after: clicks, add-to-cart, and conversions. Your integration sends those events so the assistant can learn and reporting can connect the flow to business results.

## Sending product outcome events

Send product clicks and add-to-cart events through either the [Events API](/analytics/api/events/) or the [DataLayer collector](/analytics/collector/). Pick the one that matches how your storefront already emits events — both patterns are covered below.

:::caution[Use the object identity as the product id]
The top-level `url` field on each assistant hit is the [object identity](/platform-foundations/identity/). Send this exact value as the product identifier in every click, add-to-cart, or conversion event — this is how Luigi's Box pairs the event back to the correct product.
:::

## Events API tracking

Send events as a `POST` request to `https://api.luigisbox.com/`. The examples below use this helper:

```javascript
const ANALYTICS_API_URL = "https://api.luigisbox.com/";

async function sendAnalyticsEvent(payload) {
  await fetch(ANALYTICS_API_URL, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify(payload),
  });
}
```

Report product clicks as `type: "click"` with `action.type: "click"`:

```javascript
function trackAssistantProductClick(productId) {
  return sendAnalyticsEvent({
    id: crypto.randomUUID(),
    type: "click",
    tracker_id: trackerId,
    client_id: userId,
    action: {
      type: "click",
      resource_identifier: productId,
    },
  });
}
```

Report add-to-cart as a conversion event. In the Events API, all product interaction events use `type: "click"` as the envelope type. The `action.type` field distinguishes the specific interaction:

```javascript
function trackAssistantProductAddToCart(productId) {
  return sendAnalyticsEvent({
    id: crypto.randomUUID(),
    type: "click",
    tracker_id: trackerId,
    client_id: userId,
    action: {
      type: "add-to-cart",
      resource_identifier: productId,
    },
  });
}
```

Use the same pattern for other meaningful product actions, such as wishlist or compare, with an action type that describes the action.

## DataLayer tracking

Report product clicks with `select_item`:

```javascript
function trackAssistantProductClick(productId) {
  window.dataLayer.push({
    event: "select_item",
    ecommerce: {
      items: [
        {
          item_id: productId,
        },
      ],
    },
  });
}
```

Report add-to-cart with `add_to_cart`:

```javascript
function trackAssistantProductAddToCart(productId, productPrice) {
  window.dataLayer.push({
    event: "add_to_cart",
    ecommerce: {
      currency: "EUR",
      value: productPrice || 0,
      items: [
        {
          item_id: productId,
          quantity: 1,
        },
      ],
    },
  });
}
```

## What to measure

Use assistant metrics and product outcome metrics together.

| Metric | What it tells you | How to read it |
| :-- | :-- | :-- |
| Assistant starts or activation | Whether users enter the assistant experience. | Low activation can point to weak entry-point placement, unclear teaser copy, or an assistant promise that does not match the page context. |
| Completion rate | Whether users reach the final recommendation state. | Low completion usually points to flow friction: confusing question copy, too many steps, unclear options, or a question order that asks too much too early. |
| Exit rate per question | Which question or answer set causes users to leave. | A spike on one question is a strong signal to review that question's wording, option design, or necessity. |
| Product click-through rate | Whether the returned products look relevant enough to inspect. | High completion with low product CTR usually means users trusted the flow but did not like the resulting products or product cards. |
| Add-to-cart or conversion rate | Whether assistant results lead to business outcomes. | High CTR with low conversion can point to product detail page, price, stock, or cart friction rather than the assistant flow itself. |

Read these metrics in combination. A high completion rate with low product clicks points to weak final product relevance. A low completion rate points to a flow problem: entry point, question order, question copy, option design, or too much effort.

Common patterns:

| Pattern | Likely interpretation |
| :-- | :-- |
| Low activation and low conversion | The assistant entry point may not attract the right users, or the promise is not clear enough. |
| High activation and low completion | Users are interested, but the dialogue asks the wrong questions or takes too much effort. |
| High completion and low CTR | The flow works, but the returned products or product cards are not persuasive. |
| High CTR and low conversion | The assistant is sending users onward, but something after the click is blocking the business outcome. |

## Debugging checklist

Before relying on the dashboard, check the event stream:

- The Assistant API calls use the expected `tracker_id`, `assistant_handle`, and stable `user_id`.
- Product clicks are sent when the user opens a recommended product.
- Add-to-cart is sent only when the product is actually added to cart.
- The product identifier in the click or add-to-cart event matches the identifier rendered from the assistant hit.
- DataLayer integrations push the expected ecommerce event names and product identifiers into `window.dataLayer`.
- Events API integrations send unique event `id` values.

## Related pages

- [Building a custom shopping assistant](/quickstart/shopping-assistant/building-custom-ui/)
- [Shopping Assistant implementation flow](/shopping-assistant/guides/implementation-flow/)
- [Assistant API reference](/shopping-assistant/api/assistant/)
- [Analytics overview](/analytics/)
- [Events API](/analytics/api/events/)
- [DataLayer collector](/analytics/collector/)
