Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,35 @@ if (treatment == 'on') {
</TabItem>
</Tabs>

### Append properties to impressions

[Impressions](/docs/feature-management-experimentation/feature-management/monitoring-analysis/impressions) are generated by the SDK each time a `getTreatment` method is called. These impressions are periodically sent back to Harness servers for feature monitoring and experimentation.

You can append properties to an impression by passing an object of key-value pairs to the `getTreatment` method. These properties are then included in the impression sent by the SDK and can provide useful context to the impression data.

Three types of properties are supported: strings, numbers, and booleans.

```dart
_split.client(onReady: (client) async {
final treatment = await client.getTreatment(
'FEATURE_FLAG_NAME',
properties: {
'userType': 'premium', // string
'loginCount': 42, // number
'isAdmin': true // boolean
},
);

if (treatment == 'on') {
print('Feature ON');
} else if (treatment == 'off') {
print('Feature OFF');
} else {
print('Control treatment');
}
});
```

### Shutdown

Call the `client.destroy()` method once you've stopped using the client, as this method gracefully shuts down the SDK by stopping all background threads, clearing caches, closing connections, and flushing the remaining unpublished impressions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,54 @@ val treatmentsByFlagSets = client.getTreatmentsByFlagSets(flagSets)
</TabItem>
</Tabs>

### Append properties to impressions

[Impressions](/docs/feature-management-experimentation/feature-management/monitoring-analysis/impressions) are generated by the SDK each time a `getTreatment` method is called. These impressions are periodically sent back to Harness servers for feature monitoring and experimentation.

You can append properties to an impression by passing an object of key-value pairs to the `getTreatment` method. These properties are then included in the impression sent by the SDK and can provide useful context to the impression data.

Three types of properties are supported: strings, numbers, and booleans.

<Tabs groupId="java-kotlin-choice">
<TabItem value="java" label="Java">

```java
SplitClient client = suite.client();

// Get treatment for a flag
String treatment = client.getTreatment("FEATURE_FLAG_NAME");

// Append properties with suite.track()
Map<String, Object> properties = new HashMap<>();
properties.put("package", "premium");
properties.put("admin", true);
properties.put("discount", 50L);

suite.track("flag_evaluated", null, properties);
```

</TabItem>
<TabItem value="kotlin" label="Kotlin">

```kotlin
val client = suite.client()

// Get treatment for a flag
val treatment = client.getTreatment("FEATURE_FLAG_NAME")

// Append properties with suite.track()
val properties = mapOf(
"package" to "premium",
"admin" to true,
"discount" to 50L
)

suite.track("flag_evaluated", null, properties)
```

</TabItem>
</Tabs>

### Track

Tracking events is the first step to getting experimentation data into Harness FME and allows you to measure the impact of your feature flags on your users' actions and metrics. See the [Events](/docs/feature-management-experimentation/release-monitoring/events/) documentation for more information.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Set up FME in your code base with the following two steps:

Add the Harness FME SDK, RUM agent, and Suite into your project using Swift Package Manager by adding the following package dependencies:

- [iOS SDK] (https://github.com/splitio/ios-client), latest version `3.3.3`
- [iOS SDK](https://github.com/splitio/ios-client), latest version `3.3.3`
- [iOS RUM](https://github.com/splitio/ios-rum), latest version `0.4.0`
- [iOS Suite](https://github.com/splitio/ios-suite), latest version `2.2.3`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ print(treatments)
</TabItem>
</Tabs>

### Get Treatments with Configurations
### Get treatments with configurations

To [leverage dynamic configurations with your treatments](/docs/feature-management-experimentation/feature-management/setup/dynamic-configurations), you should use the `get_treatment_with_config` method.

Expand Down Expand Up @@ -795,6 +795,61 @@ for feature_flag, treatment_with_config in result.items():
</TabItem>
</Tabs>

### Append properties to impressions

[Impressions](/docs/feature-management-experimentation/feature-management/monitoring-analysis/impressions) are generated by the SDK each time a `getTreatment` method is called. These impressions are periodically sent back to Harness servers for feature monitoring and experimentation.

You can append properties to an impression by passing an object of key-value pairs to the `getTreatment` method. These properties are then included in the impression sent by the SDK and can provide useful context to the impression data.

Three types of properties are supported: strings, numbers, and booleans.

<Tabs groupId="python-impression-properties">
<TabItem value="Multi-threaded">

```python
# Define impression properties
properties = {
"userType": "premium", # string
"loginCount": 42, # number
"isAdmin": True # boolean
}

# Get treatment with properties
treatment = split.get_treatment('key', 'FEATURE_FLAG_NAME', properties=properties)

if treatment == "on":
# Show ON treatment
elif treatment == "off":
# Show OFF treatment
else:
# Control treatment
```

</TabItem>
<TabItem value="asyncio">

```python
# Define impression properties
properties = {
"userType": "premium", # string
"loginCount": 42, # number
"isAdmin": True # boolean
}

# Get treatment with properties
treatment = await split.get_treatment('key', 'FEATURE_FLAG_NAME', properties=properties)

if treatment == "on":
# Show ON treatment
elif treatment == "off":
# Show OFF treatment
else:
# Control treatment
```

</TabItem>
</Tabs>

### Shutdown

The in-memory implementation of Python uses threads in Multi-threaded mode and tasks in asyncio mode to synchronize feature flags, segments, and impressions. If at any point in the application the SDK factory client is not longer needed, you can disable it by calling the `destroy()` method on the factory object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ treatments = split.get_treatments_by_flag_sets('key', ['backend', 'server_side']

You can also use the [Split Manager](#manager) if you want to get all of your treatments at once.

### Get Treatments with Configurations
### Get treatments with configurations

To [leverage dynamic configurations with your treatments](/docs/feature-management-experimentation/feature-management/setup/dynamic-configurations), you should use the `get_treatment_with_config` method.

Expand Down Expand Up @@ -299,6 +299,34 @@ end
</TabItem>
</Tabs>

### Append properties to impressions

[Impressions](/docs/feature-management-experimentation/feature-management/monitoring-analysis/impressions) are generated by the SDK each time a `getTreatment` method is called. These impressions are periodically sent back to Harness servers for feature monitoring and experimentation.

You can append properties to an impression by passing an object of key-value pairs to the `getTreatment` method. These properties are then included in the impression sent by the SDK and can provide useful context to the impression data.

Three types of properties are supported: strings, numbers, and booleans.

```ruby
# Define impression properties
properties = {
userType: 'premium', # string
loginCount: 42, # number
isAdmin: true # boolean
}

# Get treatment with properties
treatment = split_client.get_treatment('KEY', 'FEATURE_FLAG_NAME', properties: properties)

if treatment == 'on'
# Show ON treatment
elsif treatment == 'off'
# Show OFF treatment
else
# Control treatment
end
```

### Shutdown

Call the `.destroy` method before letting a process using the SDK exit, as this method gracefully shuts down the SDK by stopping all background threads, clearing caches, closing connections, and flushing the remaining unpublished impressions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,67 @@ Each impression contains these fields.
| Traffic type ID and name | Traffic type associated to the feature flag evaluated. |
| Treatment | Treatment that was returned. |

## Impression properties

Impression properties allow you to attach custom metadata to impressions generated by an FME SDK when calling `getTreatment`. These properties can be useful for debugging, Live Tail analysis, or downstream external analytics from third-party integrations such as Amplitude.

An example impression payload:

```json
{
"environmentId": "prod",
"feature": "new_ui",
"treatment": "on",
"key": "user_12345",
"timestamp": 1725682200000,
"properties": { // Optional key-value pairs you can append to impressions
"planType": "premium",
"appVersion": "2.3.1",
"region": "us-west"
}
}
```

### Supported SDKs for impression properties

The following SDKs support appending custom properties for each `getTreatment` call:

<Tabs queryString="impression-properties">
<TabItem value="client-sdks" label="Client-side SDKs">

| **Client-side SDK** | **Version that supports impression properties** |
|----------------------|-----------------------------------------------|
| [Android SDK](/docs/feature-management-experimentation/sdks-and-infrastructure/client-side-sdks/android-sdk#append-properties-to-impressions) | 5.2.0 and later |
| [Browser SDK](/docs/feature-management-experimentation/sdks-and-infrastructure/client-side-sdks/browser-sdk#append-properties-to-impressions) | 1.2 and later |
| [Flutter Plugin](/docs/feature-management-experimentation/sdks-and-infrastructure/client-side-sdks/flutter-plugin#append-properties-to-impressions) | 1.0.0 and later |
| [iOS SDK](/docs/feature-management-experimentation/sdks-and-infrastructure/client-side-sdks/ios-sdk#append-properties-to-impressions) | 3.2.0 and later |
| [JavaScript SDK](/docs/feature-management-experimentation/sdks-and-infrastructure/client-side-sdks/javascript-sdk#append-properties-to-impressions) | 11.2.0 and later |
| [React SDK](/docs/feature-management-experimentation/sdks-and-infrastructure/client-side-sdks/react-sdk#append-properties-to-impressions) | 2.1.0 and later |
| [Redux SDK](/docs/feature-management-experimentation/sdks-and-infrastructure/client-side-sdks/redux-sdk#append-properties-to-impressions) | 2.1.0 and later |

</TabItem>
<TabItem value="client-suites" label="SDK Suites">

| **Client-side SDK Suite** | **Version that supports impression properties** |
|----------------------|-----------------------------------------------|
| [Android Suite](/docs/feature-management-experimentation/sdks-and-infrastructure/client-side-suites/android-suite#append-properties-to-impressions) | 2.1.0 and later |
| [Browser Suite](/docs/feature-management-experimentation/sdks-and-infrastructure/client-side-suites/browser-suite#append-properties-to-impressions) | 2.1.0 and later |
| [iOS Suite](/docs/feature-management-experimentation/sdks-and-infrastructure/client-side-suites/ios-suite#append-properties-to-impressions) | 2.1.0 and later |

</TabItem>
<TabItem value="server-sdks" label="Server-side SDKs">

| **Server-side SDK** | **Version that supports impression properties** |
|----------------------|-----------------------------------------------|
| [Java SDK](/docs/feature-management-experimentation/sdks-and-infrastructure/server-side-sdks/java-sdk#append-properties-to-impressions) | 4.15.0 and later |
| [Node.js SDK](/docs/feature-management-experimentation/sdks-and-infrastructure/server-side-sdks/nodejs-sdk#append-properties-to-impressions) | 11.2.0 and later |
| [Ruby SDK](/docs/feature-management-experimentation/sdks-and-infrastructure/server-side-sdks/ruby-sdk#append-properties-to-impressions) | 8.7.0 and later |
| [Python SDK](/docs/feature-management-experimentation/sdks-and-infrastructure/server-side-sdks/python-sdk#append-properties-to-impressions) | 10.4.0 and later |

</TabItem>
</Tabs>


## Tracking impressions

Impressions are tracked by each Harness FME SDK and are periodically sent to Harness backend servers.
Expand Down Expand Up @@ -166,7 +227,10 @@ Additionally, if you don’t want to send a customer UUID to Harness as the key,

## Integrations for impression data

Use our integrations to push FME feature flag impression data to your existing platforms or your data warehouse for a comprehensive view of user engagement and other key use metrics. Integration documentation is available for the following:
Use our integrations to push FME feature flag impression data to your existing platforms or your data warehouse for a comprehensive view of user engagement and other key user metrics.

Integration documentation is available for the following:

- [Amazon S3](/docs/feature-management-experimentation/integrations/amazon-s3)
- [Amplitude](/docs/feature-management-experimentation/integrations/amplitude)
- [Full Story](/docs/feature-management-experimentation/integrations/fullstory)
Expand All @@ -178,4 +242,4 @@ Use our integrations to push FME feature flag impression data to your existing p
- [Quantum-Metric](/docs/feature-management-experimentation/integrations/quantummetric)
- [SmartBear Bugsnag](/docs/feature-management-experimentation/integrations/bugsnag)
- [Segment](/docs/feature-management-experimentation/integrations/segment)
- [Webhook (outgoing)](https://help.split.io/hc/en-us/articles/360020700232)
- [Webhook (outgoing)](/docs/feature-management-experimentation/api/webhook/impressions/)
Loading