---
schema_version: "1"
id: 4962745e39858e82c06f4732dc5e9728ad7179058dc5c51a3ca5c7e4c4190583
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.12/business-events-custom.md
canonical_url: https://docs.mulesoft.com/mule-runtime/4.12/business-events-custom
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 423d03b053a81bcd220e93c20ad195de7ce7793551c04dc8c6217cbdc80a44ee
description: MuleSoft Documentation Site
release: "4.12"
latest: false
---
---
product: Mule Runtime
version: 4.12
---

# 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.12/_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.12/_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.12/_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.12/business-events)
