---
title: Standard storefront events and actions
description: >-
  Listen for storefront events and call standard actions to work with any
  storefront from a single integration.
source_url:
  html: 'https://shopify.dev/docs/apps/build/online-store/standard-events-and-actions'
  md: >-
    https://shopify.dev/docs/apps/build/online-store/standard-events-and-actions.md
api_name: storefront-events-and-actions
---

# Standard storefront events and actions

To react to a buyer adding an item to the cart, your app used to read the storefront's DOM or intercept `window.fetch`, which meant a separate integration for every storefront. Standard storefront events and actions give every storefront the same names and payloads, so one integration works on all of them.

Storefronts dispatch an event when a buyer does something, such as viewing a product or updating the cart. You listen for those with `addEventListener`. Every standard event is named with a `shopify:` prefix and bubbles to `document`, so one listener there catches all of them. You only get an event if that storefront dispatches it, though cart changes made through [`updateCart`](https://shopify.dev/docs/api/storefront-events-and-actions/actions/update-cart) are emitted by the action itself.

You call an action when you need the storefront to change something, such as adding to cart or opening the cart. Actions are available on every Liquid storefront, and the storefront decides how each one happens, so your code works the same whether its cart is a drawer or a page.

**Use web pixels for analytics, not events:**

Standard storefront events fire regardless if buyer has consented to tracking. Use them to react on the page, not to collect behavioral data. For analytics, use [web pixels](https://shopify.dev/docs/api/web-pixels-api) instead, which respect [the buyer's consent choices](https://shopify.dev/docs/api/web-pixels-api/pixel-privacy).

[Listen for events\
\
](https://shopify.dev/docs/api/storefront-events-and-actions/events/listen)

[Read event payloads and wait on results from your app.](https://shopify.dev/docs/api/storefront-events-and-actions/events/listen)

[Call actions\
\
](https://shopify.dev/docs/api/storefront-events-and-actions/actions/call)

[Trigger storefront behavior from your app or agent.](https://shopify.dev/docs/api/storefront-events-and-actions/actions/call)

[Events and actions reference\
\
](https://shopify.dev/docs/api/storefront-events-and-actions)

[Look up every event and action, and debug them during local development.](https://shopify.dev/docs/api/storefront-events-and-actions)

***
