When you create a split you must specify a traffic type. The traffic type denotes the nature of the keys that will be passed to getTreatment for that split. Does the key identify a known logged-in user? A device? Is the key a uuid generated for an anonymous visitor and stored in a cookie on the visitor’s browser?
Traffic types in split can be customized to your particular use cases. You should have a traffic type for each type of key you plan to pass to getTreatment. The most commonly used traffic types are:
- user - the key uniquely identifies a known, logged-in user. This is typically some numeric identifier that is the primary key in the table you use to store user information.
- anonymous - the key is a randomly generated identifier, like a uuid, that identifies a visitor using a particular mobile device or browser, where it is typically stored as a cookie.
- account - the key identifies the customer account to which the (logged-in) user belongs. This traffic type is often used to maintain consistency of behavior for all visitors from a given company or account.
It is also possible, but much less common, for a traffic type to identify something other than a visitor. For instance, a realty site might use “listing” as a traffic type if they wanted to explore the possibility of having a single visitor see different appearances for different property listings. For that traffic type, the code would pass to getTreatment the id of the listing being displayed.
For some splits you may want to randomize by sessionId rather than userId, so session is another possible traffic type. Since there will be more sessions than users, with this traffic type you will end up with a higher number of unique keys being sent to Split.
You can customize traffic types as needed at any time, but it is a best practice to do so during your initial account setup, taking into account your anticipated needs. Once a split has been created with a given traffic type, that traffic type cannot be changed, so it is important to get it right the first time.
Split allows you to have up to five traffic types per workspace. All environments within a workspace will share the same set of traffic types.
By default a workspace has one traffic type named user. You can customize your traffic types as needed during your account setup.
To manage your traffic types, go to the workspaces tab in your Admin Settings page. There, you can select the workspace that you want to edit traffic types for. Add additional traffic types by clicking Add Traffic type.
Note that once a traffic type is created it cannot be edited.
You can delete a traffic type from this same location in the user interface with the delete link in the Actions column (only if it is no longer in use by any splits or metrics).
If you need assistance traffic types, we're here to help. Email our support team at email@example.com.