# Remove from cart

The following describes how remove from cart tracking is done for Firework.

## How to implement the "remove\_from\_cart" tracking event

```javascript
<script>
function onRemoveFromCart() {
    window._fwn.analytics.removeFromCart({
        "order_id": "123456789",
        "currency": "USD",
        "subtotal": "40.00",
        "total_discounts": "5.00",
        "order_value": "50.00",
        "line_items": [{
                "sku": "TSHIRT-RED-M",
                "quantity": 2,
                "price": "15.00",
                "name": "Red T-shirt (M)"
            },
            {
                "sku": "BANANA",
                "quantity": 10,
                "price": "1.00",
                "name": "Organic Banana"
            }
        ]

    });
}

// Call onRemoveFromCart() whenever there is remove from cart happening
</script>
```

Note: Please refer to the [payload section](https://docs.firework.com/firework-for-developers/web/integration-guide/shopping-integration-v2/purchase#payload-for-purchase-tags) for the required fields.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.firework.com/firework-for-developers/web/integration-guide/shopping-integration-v2/tracking/remove-from-cart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
