# Fire Event

{% embed url="<https://www.youtube.com/watch?v=lXRFnk4j-kc>" %}

Watch this on Youtube: <https://www.youtube.com/watch?v=lXRFnk4j-kc>

The **Fire Event** action triggers custom analytics events within your app. These events can be used for tracking user interactions, measuring feature usage, triggering workflows, or communicating with external analytics services.

***

#### 📦 Properties

| Property | Type  | Required | Description                                                 |
| -------- | ----- | -------- | ----------------------------------------------------------- |
| `events` | Array | ✅        | List of events to fire, each with name and optional payload |

***

#### ✅ Common Use Cases

* Tracking user interactions and feature usage
* Measuring conversion funnels and user journeys
* Triggering custom workflows based on user actions
* Sending data to external analytics platforms
* Implementing event-driven architectures
* A/B testing and feature flag implementations

***

#### ⚙️ Default Behavior

By default:

| Behavior                  | Description                                                   |
| ------------------------- | ------------------------------------------------------------- |
| **Event Processing**      | All events in the array are fired sequentially                |
| **Analytics Integration** | Events are sent to configured analytics handlers              |
| **Payload Evaluation**    | Event payloads are processed as-is (no expression evaluation) |
| **Error Handling**        | Continues processing remaining events if one fails            |

***

#### 🛠️ How to Use

<figure><img src="/files/yuTVvVB6jvU3M0Rnd1Gk" alt="Call External Method action configuration showing message name and payload fields"><figcaption><p>Call External Method action configuration in Digia Studio</p></figcaption></figure>

1. Add the action to a widget event (e.g., button tap, form submission)
2. Choose **Fire Event** from the action list
3. Add events to the `events` array with names and optional payloads

**Event Name (`name`):**

* **Required field** that identifies the type of event
* Should be descriptive and follow consistent naming conventions
* Examples: `"button_clicked"`, `"form_submitted"`, `"feature_used"`
* Used by analytics systems to categorize and track events

**Event Payload (`payload`):**

* **Optional field** containing additional data about the event as a JSON object
* Can include any relevant information (strings, numbers, booleans, arrays, nested objects)
* Supports dynamic values using expressions (e.g., `appState.currentUser`)
* Used for detailed event analysis and segmentation

***

#### 📊 Event Structure

Each event in the `events` array has the following structure:

```javascript
{
  "name": "event_name",        // Required: Event identifier
  "payload": {                 // Optional: Additional data
    "key1": "value1",
    "key2": 123,
    "key3": true
  }
}
```

***

{% embed url="<https://digiaacademy.portal.trainn.co/share/fire-event-examples>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digia.tech/logic-and-interaction/actions/fire-event.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
