---
title: App Events API
description: >-
  Send events about how customers use your extension to Shopify, where they
  appear in the Dev Dashboard and, for declared standard events, in Shopify
  Analytics.
api_version: 2027-01
source_url:
  html: >-
    https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/target-apis/platform-apis/app-events-api
  md: >-
    https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/target-apis/platform-apis/app-events-api.md
api_name: customer-account-ui-extensions
---

# App Events API

The App Events API sends [app events](https://shopify.dev/docs/apps/build/app-events) from your extension to Shopify. Shopify adds your app and the shop to each event, so your extension doesn't need network access, an access token, or a shop ID. Events appear in the [Dev Dashboard](https://shopify.dev/docs/apps/build/dev-dashboard/monitoring-and-logs) with the events that your app backend sends.

### Use cases

* **Measure extension engagement**: Send a custom event when a customer interacts with your extension, such as reordering or opening a loyalty reward.
* **Report standard events for Shopify Analytics**: Send a [standard event](https://shopify.dev/docs/apps/build/app-events/analytics/standard-event-registry) that your app has declared, so merchants can query it with ShopifyQL.
* **Skip a backend round trip**: Report what happened in the customer account without sending a request from the extension to your app's backend.

### Support Targets (24)

### Supported targets

* [customer-account.​footer.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/footer#footer-render-after-)
* [customer-account.​order-index.​announcement.​render](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/order-actions#order-index-announcement-)
* [customer-account.​order-index.​block.​render](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/order-actions#order-index-block-)
* [customer-account.​order-status.​announcement.​render](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/order-status#order-status-announcement-)
* [customer-account.​order-status.​block.​render](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/order-status#order-status-block-)
* [customer-account.​order-status.​cart-line-item.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/order-status#cart-line-item-render-after-)
* [customer-account.​order-status.​cart-line-list.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/order-status#cart-line-list-render-after-)
* [customer-account.​order-status.​customer-information.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/order-status#customer-information-render-after-)
* [customer-account.​order-status.​fulfillment-details.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/fulfillment-status#fulfillment-status-targets)
* [customer-account.​order-status.​payment-details.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/payments-and-returns#payments-and-returns-targets)
* [customer-account.​order-status.​return-details.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/payments-and-returns#return-details-render-after-)
* [customer-account.​order-status.​unfulfilled-items.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/fulfillment-status#unfulfilled-items-render-after-)
* [customer-account.​order.​action.​menu-item.​render](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/order-actions#order-action-menu-item-)
* [customer-account.​order.​action.​render](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/order-actions#order-action-)
* [customer-account.​order.​page.​render](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/full-page#order-specific-full-page-)
* [customer-account.​page.​render](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/full-page#customer-account-full-page-)
* [customer-account.​profile.​addresses.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/profile-page-default#profile-page-default-targets-)
* [customer-account.​profile.​announcement.​render](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/profile-page-default#profile-announcement-)
* [customer-account.​profile.​block.​render](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/profile-page-default#profile-block-)
* [customer-account.​profile.​company-details.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/profile-page-b2b#profile-page-b2b-targets-)
* [customer-account.​profile.​company-location-addresses.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/profile-page-b2b#company-location-addresses-render-after-)
* [customer-account.​profile.​company-location-payment.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/profile-page-b2b#company-location-payment-render-after-)
* [customer-account.​profile.​company-location-staff.​render-after](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc/targets/profile-page-b2b#company-location-staff-render-after-)
* customer-account.​profile.​payment.​render-after

### Properties

The [`shopify` global object](https://shopify.dev/docs/api/customer-account-ui-extensions/2027-01-rc#target-apis-define-what-your-extension-does) provides the app events interface for customer account extensions. Call `shopify.appEvents.emit()` with an event handle and optional attributes. The promise resolves with `{success: true}` when the host accepts the event, or `{success: false, error}` when it doesn't send it. The promise doesn't reject.

* **app​Events**

  **AppEvents**

  **required**

  Reports events to Shopify for this app.

### AppEvents

Reports events to Shopify for this app.

* emit

  Reports one occurrence of an app-defined event.

  ```ts
  (eventHandle: string, attributes?: AppEventAttributes) => Promise<AppEventEmitResult>
  ```

### AppEventAttributes

Attributes related to an app event.



### AppEventEmitResult

The outcome of an \`emit\` call. \`success: true\` means the host accepted the event. It does not confirm delivery. \`success: false\` means the event was not sent. \`error\` describes why.

```ts
{readonly success: true} | {readonly success: false; readonly error: string}
```

### Examples

* #### Send a custom event

  ##### Description

  Send a custom event when the customer clicks \*\*Reorder\*\*. This example checks the result and logs the reason when the event isn't sent.

  ##### jsx

  ```jsx
  import '@shopify/ui-extensions/preact';
  import {render} from 'preact';

  export default async () => {
    render(<Extension />, document.body);
  };

  function Extension() {
    async function handleClick() {
      const result = await shopify.appEvents.emit(
        'reorder_clicked',
        {
          item_count: 2,
        },
      );

      if (!result.success) {
        console.warn(result.error);
      }
    }

    return (
      <s-button onClick={handleClick}>
        Reorder
      </s-button>
    );
  }
  ```

***

## Best practices

* **Call `emit()` once for each occurrence**: Events from UI extensions have no `timestamp` or `idempotency_key`. Shopify records the time that it receives each event, and each call creates a separate event.
* **Check the result**: When `success` is `false`, `error` describes why the event wasn't sent, such as invalid attributes or an exceeded rate limit.
* **Don't send personal data**: Don't include any data in `attributes` that, alone or in combination with other data, could identify an individual. This includes names, email addresses, phone numbers, and customer IDs.
* **Use the full handle for standard events**: To send a standard event, use the handle that you declared in your app's [Analytics App Events configuration](https://shopify.dev/docs/apps/build/app-events/analytics/toml-configuration), including the `shopify.` prefix, and include every required attribute.

***

## Limitations

* Events are sent only when the customer has allowed analytics processing.
* Each extension can send a burst of up to 20 events, then 2 events per second. Over the limit, `emit()` returns `{success: false}`.
* Event handles have a maximum of 128 characters. `attributes` has a maximum of 15 keys, and values must be strings, numbers, or booleans.
* Events from UI extensions aren't processed for billing. To report usage for Shopify App Pricing, send a billing event from your app backend through the [App Events API](https://shopify.dev/docs/api/app-events).
* Events aren't sent from the checkout and customer accounts editor.

***
