Defines and describes standard and serialized key-value pairs.
A key-value pair consists of two related data elements: A key, which is a constant that defines the data set (e.g., gender, color, price), and a value, which is a variable that belongs to the set (e.g., male/female, green, 100). Fully formed, a key-value pair could look like these:
gender = male
color = green
price > 100
Destinations accept key-value data in standard
or serialized
format. Standard formatting organizes data into separate key-value pairs. Each key is stated explicitly, even when used again to define a different value. By contrast, serialized formatting condenses multiple values into one set defined by a single key. Also, in a serialized pair, a special indicator is used to separate the values within the key-value set. Finally, standard and serialized key-values can contain single or multiple values. The following table provides examples of standard and serial key-value formats.
Formatting | Single Key | Key-Value Pairs |
---|---|---|
Standard | x=1&x=2 |
x=1&x=2&y=3&y=4 |
Serialized | x=1;2 |
x=1;2&y=3;4 |
When working with serialized data, you must specify the characters that separate values within and between the key-value pairs. Elements in key-value pairs are defined as follows:
Type | Example | Key | Key-Value Separator | Key-Value Delimiter | Serial Separator |
---|---|---|---|---|---|
Single key (standard) | x=1&x=2 |
x |
= |
& |
n/a |
Key-value pairs (standard) | x=1&x=2&y=3&y=4 |
x,y |
= |
& |
n/a |
Single key (serial) | x=1;2;3 |
x |
= |
n/a | ; |
Key-value pairs (serial) | x=1;2&y=3;4 |
x,y |
= |
& |
; |