---
schema_version: "1"
id: 3e4babc747385b2b08d0dfad08a1c3bf2e5e4d360ddb945dd7b3ab4eb59359a7
title: Custom Business Event Component
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/mule-runtime/4.11/business-events-custom.md
canonical_url: https://docs.mulesoft.com/mule-runtime/4.11/business-events-custom
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 03c7a44fe837e57d905c84c52c0e811569d79a40188d831c8758cac7809ee705
description: MuleSoft Documentation Site
release: "4.11"
latest: false
---
---
product: Mule Runtime
version: 4.11
---

# Custom Business Event Component

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Use the Custom Business Event component (`tracking:custom-event` element in the XML view) to add
metadata and Key Performance Indicators (KPIs) to your flow. Configure the component as follows:

1.  Click the **Mule Palette** tab in Anypoint Studio.

2.  Drag **Custom Business Event** to any point of your flow.

3.  Open the component properties view and specify values for **Display Name** and **Event Name**:

    ![Setup for a custom business event](/mulesoft/current/en-us/mule-runtime/4.11/_images/mruntime-custom-business-event.png)

You can also configure Key Performance Indicators (KPIs) to capture information from the message
payload:

- In the UI:

  1.  Click the plus button (![Add icon](/mulesoft/current/en-us/mule-runtime/4.11/_images/green-plus-icon.png)\]) inside **Key Performance
      Indicators**.

  2.  Configure **Name** and **Expression / Value**:

      ![A configuration panel showing settings for a key performance indicator](/mulesoft/current/en-us/mule-runtime/4.11/_images/mruntime-business-events-kpi.png)

- In the XML:

  1.  Add a child `tracking:meta-data` element to the `tracking:custom-event`.

  2.  Configure the `key` and `value` attributes inside `tracking:meta-data`:

      For example:

      ```xml
      <tracking:custom-event doc:name="Custom Business Event" event-name="New order">
      			<tracking:meta-data key="order-id" value="#[payload.order.header.orderID]" />
      </tracking:custom-event>
      ```

For your KPIs, use names that are easy to search for in the Anypoint Runtime Manager interface, and
use a representative value, which can be any Mule expression:

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Expression / Value</th></tr></thead><tbody><tr><td><div><div><p><code>employee-id</code></p></div></div></td><td><div><div><p><code>#[payload['ID']]</code></p></div></div></td></tr><tr><td><div><div><p><code>employee-email</code></p></div></div></td><td><div><div><p><code>#[payload['Email']]</code></p></div></div></td></tr><tr><td><div><div><p><code>employee-git-id</code></p></div></div></td><td><div><div><p><code>#[payload['GITHUB_ID']]</code></p></div></div></td></tr><tr><td><div><div><p><code>price</code></p></div></div></td><td><div><div><p><code>700</code></p></div></div></td></tr><tr><td><div><div><p><code>price-after-discount</code></p></div></div></td><td><div><div><p><code>#[vars.price]</code></p></div></div></td></tr><tr><td><div><div><p><code>order-id</code></p></div></div></td><td><div><div><p><code>#[payload.order.header.orderID]</code></p></div></div></td></tr></tbody></table>

## See Also

[Business Events](https://docs.mulesoft.com/mule-runtime/4.11/business-events)
