---
schema_version: "1"
id: 92faf087285e6095c6bb2e09cf179479ce4efa7da7cdb5483ff6ba5522a68ec5
title: Transaction (<tracking:transaction/>)
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/anypoint-code-builder/acb-component-transaction.md
canonical_url: https://docs.mulesoft.com/anypoint-code-builder/acb-component-transaction
source_site: docs.mulesoft.com
content_type: documentation
content_hash: b80a8ff33b578694abe6e439d564ed5532a7a5e5f60e1147588094ea663930ab
description: MuleSoft Documentation Site
latest: true
---
---
product: Anypoint Code Builder
version: master
---

# Transaction (<tracking:transaction/>)

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

Set an identifier for all tracked events.

Use a transaction ID so that meaningful information, such as an order number, is displayed for a
transaction when analyzing tracked events at runtime, whether using Anypoint Runtime Manager or
CloudHub.

The transaction ID supports DataWeave expressions, which enables you to create an ID dynamically and
include information related to the event into the ID.

## Component XML

This component supports the following XML structure:

```xml
<tracking:transaction
    id="#[payload.orderId]"
    doc:name="Transaction"
    doc:id="qjktlq" />
```

Transaction (`<tracking:transaction/>`) attributes are configurable through the UI and XML.

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Attribute Name</th><th>Attribute XML</th><th>Description</th></tr></thead><tbody><tr><td><p><strong>Transaction</strong> (default)</p></td><td><p><code>doc:name</code></p></td><td><div><div><p>Editable name for the component to display in the canvas.</p></div></div></td></tr><tr><td><p>N/A</p></td><td><p><code>doc:id</code></p></td><td><div><div><p>Automatically generated identifier for the component.</p></div></div></td></tr><tr><td><p><strong>Id</strong></p></td><td><p><code>id</code></p></td><td><div><div><p>Defines the value of the identifier, which can be an expression or a literal. By default, the component assigns a numeric value.</p></div></div></td></tr></tbody></table>

## Examples

The following example sets a transaction ID using the `payload.orderId` value.

```xml
<flow name="flow">
...
  <tracking:transaction id="#[payload.orderId]" />
...
</flow>
```

## See Also

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

- [Configure Default Events Tracking](https://docs.mulesoft.com/mule-runtime/latest/business-events-in-components)
