Targeting With Custom Attributes
Learn how to add custom attributes to create dynamic, targeted feature rollout plans in Harness FME.
Attributes let you create dynamic targeting rules in Harness FME using runtime data passed during feature flag evaluation. You can use custom attributes to target users based on:
Rapidly changing or contextual data (for example: time since last login, browser type, app version, or device type)
Business or customer metadata (for example: subscription tier, purchase amount, or customer status).
Use segments instead of attributes when group membership changes infrequently or needs to be standardized across your organization (for example: internal users, QA teams, or strategic customer accounts).
Prerequisites
To manage custom attributes in FME Settings, you need the FME Administrator role.
Create custom attributes
You can create custom attributes in three ways:
Directly within a feature flag targeting rule
In FME Settings for reuse across a project and traffic type
Attributes created in FME Settings or through the Harness FME API are associated with a project and traffic type, and appear in your feature flag's attribute-based targeting rules as reusable User Attributes. On the other hand, attributes created directly inside an attribute-based targeting rule only exist within that feature flag definition and are not reusable across projects or traffic types.
Regardless of how a custom attribute is created, attribute values must still be passed in the SDK evaluation request (for example, getTreatment) for targeting rules to evaluate correctly. For implementation examples, refer to the relevant SDK documentation.
Create custom attributes within feature flag targeting rules
You can create custom attributes directly within a feature flag's targeting rules on the Definition tab. Attributes created within a targeting rule become part of that feature flag definition only, and are not associated with a project or traffic type.
To create and use a custom attribute in an attribute-based targeting rule, see Using custom attributes in feature flag targeting. You can also create custom attributes that use SemVer matchers for version-based targeting rules.
Create custom attributes in FME settings
You can define reusable custom attributes for a specific project and traffic type in FME Settings. Attributes created in FME Settings appear as reusable User Attributes in targeting rules for feature flags that use the same traffic type.

You can create attributes individually or bulk import them using a CSV file. If the CSV file contains attribute IDs that already exist for the selected project and traffic type, the existing attributes are overwritten.
To create a reusable custom attribute:
From the FME navigation menu, navigate to FME Settings > Projects.
Click View on the project you want to configure and navigate to the Traffic types tab.
Click View/Edit attributes for the traffic type you want to configure.
Click the Actions dropdown menu and select Create an attribute.
Enter a unique attribute identifier/key (for example,
purchase_amount) in theIDfield. Attribute IDs cannot be changed after creation. If you reuse an existing attribute ID, the existing attribute is overwritten.Enter a descriptive display name in the
Namefield (for example,Checkout Customer Cart Amount).Optionally, enter a description.
Select an attribute type: String, Number, Set, Datetime, Boolean, or Semver. If you select the String or SemVer attribute type, a Suggested values field appears.

Suggested values provide predefined values that appear in the targeting rule builder when configuring attribute-based targeting rules. Enter values as a comma-separated list (for example,
enterprise, midmarket, smb).Click Create.
The attribute is now available as a reusable User Attribute in attribute-based targeting rules for feature flags with matching traffic types.
To bulk import custom attributes:
From the FME navigation menu, navigate to FME Settings > Projects.
Click View on the project you want to configure and navigate to the Traffic types tab.
Click View/Edit attributes for the traffic type you want to configure.
Click the Actions dropdown menu and select Create multiple attributes.
Upload a CSV file containing comma-separated values. Click Download CSV template to access an example file that creates multiple attributes.
The CSV file must use the following header row:
Each row defines a custom attribute using the following fields:
FieldDescriptionID
Unique attribute identifier used in targeting rules and SDK evaluation requests. The ID cannot be changed after creation.
Name
Human-readable display name for the attribute.
Description
Optional description of the attribute.
Type
Data type of the attribute. Supported values:
String,Number,Boolean,DateTime,Set.SuggestedValues
Optional comma-separated list of suggested values. Only applies to
Stringattributes. Suggested values appear in the targeting rule builder when configuring attribute-based rules.Click Save after the upload completes.
Store identity attributes for targeting workflows
You can store identity data in Harness FME to improve targeting, debugging, and identity inspection workflows. Stored identity data enables key type-ahead suggestions, identity tooltips that display attribute values, and enriched impression analysis.

These identity-aware workflows are available in feature flag targeting rules, the Live Tail tab of a feature flag after pausing the event stream, and segment definitions when adding individual users.

When adding individual keys to targeting rules for a feature flag, you can type the leading characters of an attribute value to see matching identities from your uploaded identity data.
Type-ahead matching is case-sensitive and only matches leading characters.

Hover over a user key in the UI to view the attribute values associated with that identity.
Create identity attributes
Setting up identity attributes requires two steps:
Define reusable attributes in FME Settings for a project and traffic type.
Use the Identities API endpoints to upload identity data and associated attribute values.
EndpointDescriptionCreate or update a reusable attribute definition associated with a project and traffic type.
Create or update a single identity record while preserving unspecified attributes.
Bulk create or update multiple identity records and replace attributes for identities included in the request.
Identity data is stored per environment in Harness FME. You can upload different identity datasets for development, staging, and production environments.
Production
Upload sanitized production identity data
Staging
Upload realistic test data
Development
Upload a smaller sample dataset for testing
Stored identity data becomes available throughout Harness FME for key type-ahead suggestions, identity tooltips, targeting workflows, impression analysis, and identity inspection.
Use custom attributes in feature flag targeting
After you create a feature flag, you can add and use custom attributes in targeting rules to control treatment delivery.
To add an attribute-based targeting rule:
On the feature flag's Definition tab, click Add attribute based targeting rules in the
Targeting rulessection.
Select an existing User Attribute from the
IFdropdown menu or create an attribute directly in the targeting rule by entering an attribute ID.
Select a matcher to evaluate the attribute values passed in from your source code.

Configure the values to match and select the treatment(s) to serve.

Custom attribute types and matchers
Each custom attribute type supports a specific of comparison operators, or matchers, that can be used in attribute-based targeting rules.

When you select an existing attribute in the targeting rule builder, Harness FME only shows matchers compatible with that attribute type. You can also enter a new attribute ID directly in the IF field to create a custom attribute inline while building a targeting rule.
String attributes
String attributes store text values. Use String matchers to create targeting rules based on string comparisons, regular expressions, or lists of string values.
The following matchers are supported:
is in listis not in liststarts withdoes not start withends withdoes not end withcontainsdoes not containmatches (regular expression)does not match (regular expression)
SemVer attributes
SemVer attributes store version strings that follow the Semantic Version specification. Use SemVer matchers to create targeting rules based on application or operating system versions.
The following matchers are supported:
is =is not =is >=is <=is in listis between (inclusive)is not between (inclusive)
SemVer values must include a patch version number. For example, 2.2 is invalid, while 2.2.0 is valid. Pre-release identifiers and build metadata are also supported.
Supported SDKs and customer-deployed components for SemVer matcher
SemVer matchers are only supported in specific SDK and customer-deployed component versions. If your SDK or customer-deployed component version does not support SemVer matchers, upgrade to a supported version to ensure targeting rules evaluate correctly.
If an unsupported SDK evaluates a feature flag containing a SemVer matcher, the SDK returns the control treatment and logs a corresponding impression event.
The following versions support SemVer matchers:
Client-side SDK Suite
Version that supports SemVer
Android SDK Suite
1.2.0 and later
Browser SDK Suite
1.4.0 and later
iOS SDK Suite
1.2.0 and later
Client-side SDK
Version that supports SemVer
Android SDK
4.1.0 and later
Angular utilities
3.0.0 and later
Browser SDK
0.14.0 and later
Flutter plugin
0.1.9 and later
iOS SDK
2.25.0 and later
JavaScript SDK
10.26.0 and later
React SDK
1.12.0 and later
React Native SDK
0.9.0 and later
Redux SDK
1.12.0 and later
Server-side SDK
Version that supports SemVer
Go SDK
6.6.0 and later
Java SDK
4.12.0 and later
.NET SDK
7.9.0 and later
Node.js SDK
10.26.0 and later
PHP SDK
7.3.0 and later
PHP Thin Client SDK
See SplitD version
Python SDK
9.7.0 and later
Ruby SDK
8.4.0 and later
Component
Version that supports SemVer
Split Daemon
1.4.0 and later
Split Evaluator
2.6.0 and later
Split Synchronizer
5.8.0 and later
Split Proxy
5.8.0 and later
JavaScript synchronizer tools
0.6.0 and later
Set attributes
Set attributes store lists of string values. Use Set matchers to create targeting rules based on membership in multiple values.
The following matchers are supported:
is equal tois not equal tohas any ofdoes not have any ofhas all ofdoes not have all ofis part ofis not part of
Number attributes
Number attributes store positive or negative whole numbers. Decimal values are not supported. Use Number matchers to create targeting rules based on thresholds or ranges.
The following matchers are supported:
is =is >=is <=is between (inclusive)is not between (inclusive)
DateTime attributes
Depending on the SDK you are using, DateTime values must be passed as either milliseconds since epoch or seconds since epoch. Use DateTime matchers to create targeting rules based on time windows.
The following matchers are supported:
is onis not onis afteris beforeis between (inclusive)is not between (inclusive)
Boolean attributes
Boolean attributes store either true or false. Use Boolean matchers to create targeting rules based on conditions.
The supported matcher is is.
Use regex with custom attributes
String attributes support regex-based matching for advanced targeting scenarios. If your application versions follow semantic versioning, Harness recommends using SemVer matchers instead of regex whenever possible.
Troubleshooting
Last updated
Was this helpful?








