Contact Us 1-800-596-4880

Custom Event (<tracking:custom-event/>)

Add metadata and Key Performance Indicators (KPIs) to your flow through a custom business 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:

Name Expression / Value

employee-id

#[payload['ID']]

employee-email

#[payload['Email']]

employee-git-id

#[payload['GITHUB_ID']]

price

700

price-after-discount

#[vars.price]

order-id

#[payload.order.header.orderID]

Component XML

This component supports the following XML structure:

<tracking:custom-event
    event-name=""
    doc:name="Custom event"
    doc:id="akfkag" />

Custom Business Event (<tracking:custom-event/>) attributes are configurable through the UI and XML.

Attribute Name Attribute XML Description

Custom event (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Event name

event-name

Name of the event to track.

Inherits

inherits

N/A

Meta data

metaData

N/A

Target Variable

target

Name of the variable in which you want to store message data. Names can only include numbers, characters, and underscores. For example, hyphens are not allowed in the name. See Enrich Data with Target Variables in the Mule documentation.

Target Value

targetValue

Value of the data to store in the target variable. By default, the value is the message payload (payload). The field accepts any value that a variable accepts: any supported data type, DataWeave expressions, the keywords payload, attributes, and message, but not the keyword vars. See Enrich Data with Target Variables in the Mule documentation.

The child element <tracking:meta-data/> attributes are configurable through the UI and XML.

Attribute Name Attribute XML Description

N/A

key

Name of the KPI.

N/A

value

Value of the KPI.

Example

The following example configures a tracking event and a KPI.

<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>

See Also