# Product events

> Product views recorded by the tracking script.



## product.viewed

> Sent when the tracking script records a product view, from a contact or an anonymous visitor. Alpha: open to the Emailit team only.

# product.viewed

Sent each time the [tracking script](/docs/commerce/connect-your-shop/#record-shop-activity)'s `product` command records a product view. Views come from known contacts and from anonymous visitors. When an anonymous visitor is identified later, their earlier views count for the contact, but the events already sent keep `contact_id` set to `null`. See [Commerce](/docs/commerce/#events).

> **Commerce is in alpha:** Commerce is open only to the Emailit team while we test it. See [Who can use Commerce](/docs/commerce/#who-can-use-commerce).

Product views come from site traffic, so webhooks that receive **All events** don't get this event. Subscribe to `product.viewed` by name.

Webhook requests carry a JSON array of events like this one; see [Webhook requests](/docs/webhooks/webhook-requests/).

```json
{
  "event_id": "evt_3xbB2QmL7cVn0Rk8sWd4TfY1uHa",
  "type": "product.viewed",
  "object": {
    "object": "product_view",
    "product": {
      "id": "prd_3Rx6aB1cD2eF3gH4iJ5kL6mN7oP",
      "external_id": "8123456789",
      "title": "Trail running shoe",
      "url": "https://shop.example.com/products/trail-running-shoe",
      "image_url": "https://shop.example.com/images/trail-running-shoe.jpg",
      "price": 89,
      "currency": "USD"
    },
    "contact_id": "con_3EwrXnu9OaQWlfI1AyPUUEoYjQs",
    "email": "ada@example.com",
    "anonymous_id": "anon_5f0c9e2b7d1a4c8e9b3f6a2d1c0e7b4a",
    "viewed_at": "2026-10-19T09:12:40.512Z",
    "source": "js",
    "context": {
      "page": {
        "url": "https://shop.example.com/products/trail-running-shoe",
        "path": "/products/trail-running-shoe",
        "title": "Trail running shoe"
      },
      "campaign": { "source": "emailit", "medium": "email", "name": "Autumn sale" },
      "timezone": "Europe/Prague"
    }
  },
  "data": {
    "object": {
      "object": "product_view",
      "product": {
        "id": "prd_3Rx6aB1cD2eF3gH4iJ5kL6mN7oP",
        "external_id": "8123456789",
        "title": "Trail running shoe",
        "url": "https://shop.example.com/products/trail-running-shoe",
        "image_url": "https://shop.example.com/images/trail-running-shoe.jpg",
        "price": 89,
        "currency": "USD"
      },
      "contact_id": "con_3EwrXnu9OaQWlfI1AyPUUEoYjQs",
      "email": "ada@example.com",
      "anonymous_id": "anon_5f0c9e2b7d1a4c8e9b3f6a2d1c0e7b4a",
      "viewed_at": "2026-10-19T09:12:40.512Z",
      "source": "js",
      "context": {
        "page": {
          "url": "https://shop.example.com/products/trail-running-shoe",
          "path": "/products/trail-running-shoe",
          "title": "Trail running shoe"
        },
        "campaign": { "source": "emailit", "medium": "email", "name": "Autumn sale" },
        "timezone": "Europe/Prague"
      }
    }
  }
}
```

## Fields

- `event_id` (string): Event ID (`evt_…`). A retried request carries the same ID, so use it to skip events you already handled. You can also look the event up with [Retrieve an event](/docs/api-reference/events/get/).

- `type` (string): Always `product.viewed`.

- `object` (object): The product view the event describes. Its fields are listed below.

- `data.object` (object): The same object again, in the shape that the [Events API](/docs/api-reference/events/get/) returns in `data`.

### Product view object

- `object` (string): Always `product_view`.

- `product` (object): The viewed product: `id` (`prd_…`, `null` when the product isn't in your catalog), `external_id` (the product ID in your shop), `title`, `url`, `image_url`, `price` and `currency`. Values come from your [catalog](/docs/api-reference/products/get/) when the product is in it, and from the `product` call otherwise.

- `contact_id` (string | null): The contact who viewed the product (`con_…`), or `null` for an anonymous visitor.

- `email` (string | null): The contact's email address, or `null` for an anonymous visitor.

- `anonymous_id` (string | null): The tracking script's ID for the visitor's browser.

- `viewed_at` (string): When the visitor viewed the product, in ISO 8601 UTC.

- `source` (string): Always `js` (the tracking script).

- `context` (object | null): What the script knows about the visit: `page` (`url`, `path`, `title`, `referrer`), `campaign` (UTM values), `locale`, `timezone`, `library` and `user_agent`. The same fields as on [events from the tracking script](/docs/events/tracking-script/#what-the-script-sends).

---
Source: https://emailit.com/docs/webhooks/events/product/product-viewed/
