> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upstackdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# view_cart Event

> Track when a visitor views their shopping cart

Fires when a visitor views their shopping cart. This helps track cart abandonment and build remarketing audiences for shoppers who haven't completed checkout.

<Note>
  **Shopify:** Automatically tracked when the cart page or cart drawer is viewed.
</Note>

## JavaScript

```javascript theme={null}
window._upstack('track', 'view_cart', {
  items: [
    {
      id: 'SKU_12345',
      name: 'Classic Cotton Tee',
      price: 34.99,
      quantity: 2
    },
    {
      id: 'SKU_67890',
      name: 'Running Socks',
      price: 14.99,
      quantity: 1
    }
  ],
  value: 84.97,
  currency: 'USD'
});
```

## Properties

| Property | Type   | Required | Description                                                              |
| -------- | ------ | -------- | ------------------------------------------------------------------------ |
| items    | array  | Yes      | Products in cart (see [Item Object](/pixel/standard-events#item-object)) |
| value    | number | No       | Total cart value                                                         |
| currency | string | No       | ISO 4217 currency code                                                   |

## When to Fire

* Cart page load
* Cart drawer/sidebar open
* Mini-cart expansion

## Related Events

* [add\_to\_cart](/pixel/events/add-to-cart) — When adding items to cart
* [product\_removed\_from\_cart](/pixel/events/product-removed-from-cart) — When removing items
* [initiate\_checkout](/pixel/events/initiate-checkout) — When starting checkout
