---
title: Decision notification listener
slug: feature-experimentation/docs/decision-notification-listener
docTags: 
createdAt: 2026-08-05T20:39:58.000Z
---

The decision notification listener is triggered by the [decide methods](docId:-yq2-thNRv7-SgwCXpG90). It is most commonly used to send decisions to an analytics provider or to an internal data warehouse to join it with other data that you have about your users.

:::hint{type="info"}
**Note**
If you only want decisions that resulted in impressions in the Optimizely app, you can filter on the *dispatched decision event* field of the returned `OptimizelyDecision` object in your code.
:::

To track flag usage, complete the following:

1. Sign up for an analytics provider of your choice (for example, Segment).
2. Configure a decision notification listener.
3. Follow your analytics provider's documentation and send events from within the decision listener callback.

Steps 1 and 3 are not covered in this documentation.

## Parameters

The following table shows the information provided to the listener when it is triggered:

| Field             | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ----------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **type**          | string | Decision type varies depending on which method triggers the listener. The decide methods set the type to \`flag\`.                                                                                                                                                                                                                                                                                                                    |
| **decision info** | map    | Key-value map that consists of data corresponding to the decision. See \[decision-info parameter]\(https\://docs.developers.optimizely.com/feature-experimentation/docs/decision-notification-listener#decision-info-parameter).                                                                                                                                                                                                      |
| **user ID**       | string | The user ID.                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **attributes**    | map    | A map of custom key-value string pairs specifying attributes for the user that are used for \[audience targeting]\(https\://support.optimizely.com/hc/en-us/articles/38683417490957). Non-string values are only supported in SDK versions 3.0 and above (released after March 2019) for most SDKs. See \[SDK compatibility matrix]\(https\://docs.developers.optimizely.com/feature-experimentation/docs/sdk-feature-compatibility). |

### `decision info` parameter

The following table shows the decision info parameter of the decision notification listener:

| Decision info parameter       | Description                                                                                                                                                                                                                                                                                                                                                               |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **flag key**                  | The flag key.                                                                                                                                                                                                                                                                                                                                                             |
| **enabled**                   | Boolean value for whether the flag is enabled or not.                                                                                                                                                                                                                                                                                                                     |
| **variables**                 | The same object as returned by \`my\_decision.variables\`.                                                                                                                                                                                                                                                                                                                |
| **variation key**             | The key of the flag variation.                                                                                                                                                                                                                                                                                                                                            |
| **rule key**                  | The key of the flag rule.                                                                                                                                                                                                                                                                                                                                                 |
| **decision event dispatched** | A Boolean value indicating if the decision dispatched a decision event to \`logx.optimizely.com\`. In the \[Optimizely app]\(https\://app.optimizely.com), an impression on the \[Experimentation Results page]\(https\://support.optimizely.com/hc/en-us/articles/38941449370893-Analyze-results-in-Feature-Experimentation) corresponds to a dispatched decision event. |
| **experiment ID**             | Experiment assignment ID.                                                                                                                                                                                                                                                                                                                                                 |
| **variation ID**              | Variation assignment ID.                                                                                                                                                                                                                                                                                                                                                  |

## Examples

For code examples, see the following SDK documentation on notification listeners:

- [Android SDK](docId:7YBxDk67DRrkZf3FbyIJ-)
- [C# SDK](docId\:Ee1jEssfFPw17lJyVP9m9)
- [Flutter SDK](docId\:HK9-OAb_ZXtphGmvU8Uga)
- [Go SDK](docId\:t5MKaa3LIkBM5ovyv7XYn)
- [Java SDK](docId\:CaIM2oX09aWIajqNcz0Ct)
- [JavaScript SDK](docId\:iYEM6cOT51dak_I7ellNY) – SDK versions 6.0.0 and later.
- [JavaScript (Browser) SDK](docId\:qykXcla2WZgtq4LHGWSfU) – SDK versions 5.3.5 and earlier.
- [JavaScript (Node) SDK](docId\:qykXcla2WZgtq4LHGWSfU) – SDK versions 5.3.5 and earlier.
- [PHP SDK](docId\:B3h4PE4eFEjjhKpiue0N_)
- [React SDK](docId\:eyOn7CmG5jWwB3vIm7mt9)
- [React Native SDK](docId:04d5tm_qqBTXKMKKnh1rZ)
- [Ruby SDK](docId:0pKUE1RjpxrcY4xgjh1Y3)
- [Python SDK](docId\:EjbZOLZ2M6aN5QW0T1Ufy)
- [Swift SDK](docId\:olc5F0M6g6El8a0puGbRX)
