Winning Variant considers a subject anything that is assigned a variant within an experiment. Think of a subject as a patient in a drug trial. Traditionally, a subject is a user (known or anonymous), but can be any other thing that seems one thing over another, such as a mobile or IoT device.

Subjects can have various ways of being identified (such as a known customer ID or an anonymous cookie ID). We call these Subject Types and are completely customizable within the platform. Here are some examples of typical Subject Types:

  • Anonymous User ID: such as a random UUID stored in a cookie in a user’s browser
  • User/Customer ID: a persistent ID that tells you exactly who someone is. Values used here are sometimes the CRM ID (such as Salesforce ID) or primary key in your own database.
  • MAC Address: when experiment assignments are done at the device level.
  • Customer Group: if you wish for all users within a particular customer group/segment to experiment the same experiment variation, you can use this level of grouping.

All possible Subject Types can exist at once within the platform and are used only for the experiments that depend on them.

YAML

Metadata

The possible statuses for subject types are: active or archived. parentKind and parentId should be excluded.

When defining a resource in YAML, each must have a metadata section. The following properties within metadata are shared across all resource types:

KeyData TypeDescription
idstringUnique identifier. Must be lowercase and consist of alphanumeric characters, ’-’, ’_’ or ’.’ For example: home-page-test
namestringName of the resource.
descriptionstringDescription of the resource.
resourceVersionintModification version for a given resource. Incremented each time the resource is updated. This will be shown when retreiving a resource, but is ignored if provided as part of a resource update.
statusResourceStatusThe status of the resource.
parentKindlabThe kind of resouce this one belongs to. Only applies to experiments, in which case the value is lab. Exclude for non experiments.
parentIdstringThe ID of the resources parent. Only applies to experiments and the ID of its parent lab. Exclude for non experiments.

ResourceStatus

Possible statuses include:

StatusDescriptionResources
draftThe experiment exists, but is not ready to go live.Experiment
activeThe experiment is live and making/tracking/returned assignments.All
winner_declaredA winner has been declared.Experiment
endedThe experiment has ended. No assignments are made/returned.Experiment
archivedThe experiment has ended and is archived from view.All

Spec

The spec for a Subject Type includes the following:

KeyData TypeDescription
matchTypeMatchTypeThe type of subject and how to match identifiers. See below.
matchRegexstringIf Match Type is CUSTOM, this specifies the Regex to use to validate identifiers.

MatchType

Built-in Subject Type match types include:

Match TypeDescriptionRegex Used
UUIDa standard UUID of any version^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$
MAC_IDA computer MAC address^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$
KSUIDSegment KSUID^[0-9a-zA-Z]{27}$
IOS_INSTALLATION_IDiOS Installation ID^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$
ANDROID_INSTALLATION_IDAndroid Installation ID^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$
AUTH0_IDID for Auth0 user accounts.^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89abAB][0-9a-f]{3}-[0-9a-f]{12}$
SEGMENT_IDSegment user IDs^[0-9a-f]{32}$
CUSTOMCustom regular expression validation.Specified by match_regex

Examples