Overview
With custom attributes, you can create dynamic and targeted feature rollout plans using any criteria or dimension of your customers.
Attributes are recommended when you need to target customers in real time, such as:
- Temporal or fast moving data (for example, time since last login, customer creation date, browser type, or machine)
- Sensitive information (for example, customer deal size or customer status)
When deciding whether to use segments or attributes, segments are best when customers in a segment do not change multiple times in a day or the grouping of customers needs to be standardized across your organization (for example, key accounts, internal or outsourced QA teams, company employees).
Types and matchers
As you design your rollout plans using custom attributes, be aware of the different types of attributes that we support as well as the matchers that can be used for each type.
String literal attributes
String literal attributes capture the concept of a character string. Use this attribute to do standard string to string comparisons, but also to target your customers with any list or picklist dimension that you track. Use this matcher type to target using a regular expression. Use string attributes with the following matchers:
- is in list
- is not in list
- starts with
- does not start with
- ends with
- does not end with
- contains
- does not contain
- matches (regular expression)
- does not match (regular expression)
Set attributes
Set attributes capture the concept of a list of strings. Use set attributes with the following matchers:
- is equal to
- is not equal to
- has any of
- does not have any of
- has all of
- does not have all of
- is part of
- is not part of
Numeric attributes
Numeric attributes capture the concept of signed integers. Negative numbers are allowed. Floating point numbers are not supported. Use numeric attributes with the following matchers:
- is =
- is >=
- is <=
- is between (inclusive)
- is not between (inclusive)
DateTime attributes
DateTime attributes capture the concept of a date, with optional time. Express the value of these attributes in milliseconds since epoch. Use DateTime attributes with the following matchers:
- is on
- is not on
- is on or after
- is on or before
- is between (inclusive)
- is not between (inclusive)
Boolean attributes
Boolean attributes capture the concept of true or false. Use boolean attributes with the following matcher:
- is
FAQs
What happens if a split uses an attribute whose value is not provided in code?
For instance, take this split definition.
if user.age <= 60 then split 100%:on
else
if user is in segment all then split 100%:off
If the value for the age
attribute is not provided in the attributes map passed to the getTreatment
call, the matcher in the first condition user.age <= 60
does not match. The user gets the evaluation of the second condition if user is in segment all then split 100%:off
, which is off.
What happens if a split uses an attribute whose value in code is not of the correct type?
For instance, take this split definition.
if user.plan_type is in list ["basic"] then split 100%:on
else
if user is in segment all then split 100%:off
And say the value provided for plan_type
is an int instead of a string. The value for plan_type
should be a string, however, the passed in value is a number. In this scenario, the matcher in the first condition user.plan_type is in list ["basic"]
does not match. The user gets the evaluation of the second condition if user is in segment all then split 100%:off
, which is off.
How can I use boolean types?
The SDK does not currently provide matchers specifically for booleans. You can either translate booleans into a numeric attribute 1 or 0
and use the is = 1
matcher, or a string attribute true or false
and use the is in list ["true"]
matcher.
Use custom attributes
The instructions in this section walk you through the proper use of attributes when creating rollout plans in the Split web console. To understand the proper syntax for using attributes with the SDK in your code base, refer to the relevant language-specific article in our SDK Documentation.
Input the attribute
Split allows you to completely customize the attributes you use in your treatment evaluation. When defining your targeting rules, you can amend your traffic type to target based on any custom attribute you provide. To do this, add an attribute in the field provided.
Select the matcher
When you have input a custom attribute, you are prompted to choose a matcher. Read more about the available matchers above.
Set the attribute value
After you select a matcher, select the values for the attribute that you want Split to match. Below are a few examples of usage for different types of attributes.
-
Show the on treatment for users with custom attribute
plan_type
equal to premium. -
Show the on treatment for users with custom attribute
registered_date
on or after a specified date. -
Show the on treatment for users with custom attribute
age
greater than or equal to 20. -
Show the on treatment for users with custom attribute
deal_size
between 500,000 and 10,000,000.
Comments
0 comments
Please sign in to leave a comment.