> This page is for Developer.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bigcommerce.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bigcommerce.com/_mcp/server.

# Shopper Events

## Real-time shopper events

To ensure product recommendations are up to date, BigCommerce sends new shopper events in near real-time.
The real-time eventing pipeline trains ML models by sending shopper events along with attribution tokens to associate shopper responses with recommended products.

## Shopper event schema

BigCommerce sends the following data to your GCP account for the supported events:

*Product Detail Page View Event*

```js showLineNumbers={false}
var user_event = {
  "eventType": "detail-page-view",
  "visitorId": "visitor-id",
  "attribution_token": "Token retrieved from Google as part of prediction request."
  "productDetails": [{
    "product": {
      "id": "product-id"
    }
  }]
};
```

*Purchase Complete Event*

```js showLineNumbers={false}
var user_event = {
  "eventType": "purchase-complete",
  "visitorId": "visitor-id",
  "attribution_token": "Token retrieved from Google as part of prediction request."
  "productDetails": [{
    "product": {
      "id": "product-id"
    },
    "quantity": product-quantity
  }],
  "purchaseTransaction": {
    "revenue": revenue,
    "currencyCode": "currency-code"
  }
};
```

We will add the following user events in the future:

* `add-to-cart`
* `category-page-view`
* `home-page-view`
* `search`
* `shopping-cart-page-view`

For a more detailed explanation about each field, see the [User Events](https://cloud.google.com/retail/docs/user-events#detail-page-view) article in the Google documentation.