When you create a split, you must specify a traffic type. The traffic type denotes the nature of the keys that are 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.
Customize a traffic type
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 10 traffic types per workspace. All environments within a workspace 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 create traffic types, do the following:
- From the left hand navigation, select the initials at the top and then Admin settings. The Workspaces page appears.
- Select the workspace that you want to edit traffic types for.
- To add more traffic types to the selected workspace, click View and then the Traffic types tab.
- Click the Actions button and then Add traffic types in the list. The Create traffic type screen appears.
- Enter a name and click Save. A new traffic type is created.
Note: 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 but only if it is no longer in use by any splits or metrics.
If you need assistance with traffic types, email our support team at email@example.com.
Please sign in to leave a comment.