Skip to content

Commit 13d0c4e

Browse files
authored
Update Custom Prop Randomization page (#823)
* Update Custom Prop Randomization page * Fix content * More content changes
1 parent 191f86f commit 13d0c4e

File tree

2 files changed

+49
-19
lines changed

2 files changed

+49
-19
lines changed

docs/platform/feature-flags/targeting/randomize-using-custom-property.md

Lines changed: 49 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,68 @@ title: Randomize using a Custom Property
33
sidebar_position: 6
44
---
55

6-
:::warning
7-
To use this functionality in conjunction with Server-Side SDKs you must ensure you are on at least these SDK versions:
8-
- DotNet 4.1.0
9-
- Go 2.18.1
10-
- Java 2.3.0
11-
- Node.js 1.19.0
12-
- Python 3.7.0
13-
- Ruby 3.2.0
14-
- SDK Proxy 2.2.0
15-
:::
6+
DevCycle uses User ID as the primary key for delivering variations, rolling out a [feature](docs/platform/feature-flags/features.md), and randomizing distribution. However, there are cases in which a User ID is not the primary identifier of the request to DVC, thus making the usage of DevCycle features, specifically Gradual Rollouts, difficult in these scenarios.
7+
8+
This functionality allows you to set a [Custom Property](docs/platform/feature-flags/targeting/custom-properties.md) as the key to rollout / distribute on rather than User ID. Account, Organization, Tenant or Store IDs are some commonly used examples. At DevCycle, we use this feature to gradually roll out new functionality on an organization-by-organization basis rather than on a user-by-user basis to ensure all users in the same organization see the same features.
9+
10+
## Minimum Supported Server SDK Versions
1611

17-
DevCycle uses User ID as the primary key for delivering variations, rolling out a feature, and randomizing distribution. However, there are cases in which a User ID is not the primary identifier of the request to DVC, thus making the usage of DevCycle features, specifically Gradual Rollouts, difficult in these scenarios.
12+
To use this functionality in conjunction with Server-Side SDKs, ensure that you are on the following **minimum** SDK versions. Client-side SDKs do not have any version requirements.
1813

19-
This functionality allows you to set a [Custom Property](docs/platform/feature-flags/targeting/custom-properties.md) as the key to roll out / distribute on rather than User ID, such as Account, Organization, Tenant or Store ID. For example, at DevCycle, we would use this feature to gradually roll out new functionality on an organization-by-organization basis rather than on a user-by-user basis to ensure all users in the org see the same features.
14+
| SDK Type | Minimum Version |
15+
| - | - |
16+
| Node.js | 1.19.0 |
17+
| Go | 2.18.1 |
18+
| Java | 2.3.0 |
19+
| DotNet | 4.1.0 |
20+
| Python | 3.7.0 |
21+
| Ruby | 3.2.0 |
22+
| SDK Proxy | 2.2.0 |
23+
24+
## Targeting Rule setup using a Custom Property for Randomization
2025

21-
## Setting Up a Targeting Rule using an Custom Property for Randomization
2226
Since this functionality is only relevant in specific Targeting Rule use cases, the option to randomize using a Custom Property will only appear when you:
2327

24-
* Serve `Random Distribution` (ie. [run an experiment](/platform/experimentation/feature-experimentation#experimentation-using-a-custom-property-for-randomization))
28+
* Serve `Random Distribution` (i.e. [run an experiment](/platform/experimentation/feature-experimentation#experimentation-using-a-custom-property-for-randomization))
2529
* Select a `Gradual Rollout`
2630
* Select a `Multi-Step Rollout`
2731

28-
The `Randomize Using` field will appear at the bottom of the Targeting Rule, under the `Schedule` section. The dropdown will also populate with all existing Custom Properties. Select the Custom Property you wish to use for your random distribution or rollout.
32+
The `Randomize Using` field will appear at the bottom of the Targeting Rule, under the `Schedule` section. The dropdown will be populated with all existing Custom Properties from your project. Select the Custom Property you wish to use for your random distribution or rollout.
2933

3034
![Randomize Using field in Targeting Rules](/custom-property-randomization-rollouts.png)
3135

32-
## Expected Behaviour when Using a Custom Property as the Randomization Key
36+
If you haven't setup Custom Properties, you'll have to create them on the dashboard and define them in code. Take a look at our [Custom Properties](/platform/feature-flags/targeting/custom-properties) page for more info. Here's a sample of how that's setup with the React SDK.
37+
38+
```jsx
39+
import { useDevCycleClient } from '@devcycle/react-client-sdk'
40+
41+
const user = {
42+
user_id: 'user123',
43+
customData: {
44+
// These are Custom Properties
45+
organization: "org_001",
46+
jurisdictionId: 987,
47+
isBetaUser: false
48+
},
49+
}
50+
const client = useDevCycleClient()
51+
client.identifyUser(user)
52+
```
53+
54+
### Behaviour when the Randomize Using Custom Property is Undefined
3355

3456
:::info
35-
Note: If a user does not have the specficied Custom Property key, DevCycle will treat a non-existent randomization key as a static null value. (e.g. "Region" : "null")
57+
If a user does not have the specified Custom Property key, DevCycle will treat the non-existent Randomization key as a static null value (e.g. "Organization": null) and may continue to rollout / distribute the Feature to the user.
3658
:::
3759

38-
In this case, DevCycle only considers the Targeting Rule definition and does not require a user to have the selected Custom Property defined. Users without a defined randomization key will all be bucketed into the same variation.
60+
DevCycle only considers the Targeting Rule `Definition` for eligibility in receiving a Feature and does not require a user to have the selected "Randomize Using" Custom Property defined. Users without a defined randomization key will proceed to be bucketed, but these users will all be bucketed into the same variation and rollout threshold.
61+
62+
If you want to ensure that you only rollout and/or distribute variants to users who have the selected Custom Property defined, then you must add a filter to your Targeting Rule Definition that targets users where the Custom Property `exists`. If this filter is included in the Targeting Rule definition, users without a value for that Custom Property will not qualify for that rule. Instead, they will be evaluated against the next rule (if one exists), or they will receive the code defaults. Example of such a targeting rule setup:
63+
64+
![Randomize Using Targeting Rule Setup](/custom-property-randomization-property-exists.png)
65+
66+
## Experimentation using a Custom Property for Randomization
67+
68+
In terms of Experimentation, randomization based on Custom Properties allows you to rollout specific variations of your application to user groups that share the same `Custom Property`. This gives you more flexibility to Experiment and A/B test on groups of users that are defined by your Custom Properties, or by another identifier that is not the User ID.
3969

40-
If you want to ensure that you only target users who have the selected Custom Property, then you must add a filter where Custom Property `exists`. If this filter is included in the Targeting Rule definition, users without a value for that Custom Property will not qualify for that rule. Instead, they will be evaluated against the next rule, if one exists, or they will receive the code default.
70+
Learn more about random distribution within the context of experimentation on the [Feature Experimentation](https://docs.devcycle.com/platform/experimentation/feature-experimentation/#experimentation-using-a-custom-property-for-randomization) page.
191 KB
Loading

0 commit comments

Comments
 (0)