Visitor profile attributes (Parameters)
Overview
This topic provides some details related to visitor profile parameters and their features. This is also known as Visitor Attributes.
There are a various reasons why you would want to write an attribute to a visitor profile. The primary reason is so that information that is obtained within a user session can be written to the profile for immediate use in Real-Time decisions as well as so that data can be captured and written back to the database for constructing a more complete and up-to-date visitor profile.
Here are a couple of examples of how visitor attributes can be used:
A customer made a purchase in a given session and used a coupon that was a one-time-use-only coupon, and you don't want to display discount information if the user continues to browse the site.
A customer provided an email and the consent to be sent marketing messages in a session. You do not want to continue to ask them for this information or the consent later in that session or in future sessions, so storing an attribute or attributes that this information and consent has already been provided would enhance the user experience.
Visitor attribute features
Below is a section of visitor attributes from the Visit
endpoint in Swagger. Below that you will find details related to each of the features and options.
"VisitorAttributes": [
{
"Name": "string",
"Value": "string",
"ValueList": [
"string"
],
"ValueJSON": {},
"UpdateOperator": 0
}
Name
This is the name of the attribute in the Visitor Profile that the Value(s) will be stored in.
Values
There are three types of values that you can store in an attribute:
A single value
A list of values (array)
A JSON object as a value
Single value
This is a single key/value pair, and the options are to set it or delete it.
Example call
![](../__attachments/3865706579/image-20230407-184108.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
Attribute in cache
![](../__attachments/3865706579/image-20230407-210928.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
Value Real-Time decisions
You use an Attribute List Realtime Decision with this type of attribute in the visitor profile.
![](../__attachments/3865706579/image-20230407-211118.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
List of values (array)
This is a Key/Value List or array of values. You can set it to a single value and then add or remove values, or you can set, add, or remove multiple values at one time, as well as delete the attribute.
The update operators 2 and 3 are used with this type of attribute only. As mentioned above, you can push or pull values or sets of values to the list. When pushing values or sets of values, they are added to the end of the list. When you pull a value or list of values, it pulls the first value(s) that matches the value or value list that is passed as a part of the call. The search is performed from top-to-bottom or right-to-left, depending how the list is displayed. If you have the same value multiple times in your list, when you are trying to pull from the list, it will only pull the first occurrence and leave the rest.
Example call: Sets a list
UpdateOperator = 0
Example call
![](../__attachments/3865706579/image-20230407-184227.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
Attribute in cache
![](../__attachments/3865706579/image-20230407-211222.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
Example call: Adds to the list
UpdateOperator = 2
Example call
![](../__attachments/3865706579/image-20230407-211438.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
Attribute in cache
![](../__attachments/3865706579/image-20230407-211548.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
Example call: Remove from the list
UpdateOperator = 3
Example call
![](../__attachments/3865706579/image-20230407-211843.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
Attribute in cache
The first instance of parameter_value5
was removed.
![](../__attachments/3865706579/image-20230407-212011.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
Value list Real-Time decisions
You use an Attribute List Real-Time Decision with this type of attribute in the visitor profile. In this case, you will typically use the custom > aggregate option within the criterion configuration.
![](../__attachments/3865706579/image-20230407-132216.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
Compare frequency
This aggregate allows you to compare the frequency of one value compared to another in the list. The collection name is the name of the attribute, and the other two fields you enter what values to look for in the list. In this example, we are looking at the attribute product_category
and seeing if there are more instances of the value pants
than the value shirts
.
![](../__attachments/3865706579/image-20230407-132707.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
Frequency counts
This aggregate allows you to compare how many instances of a value are in the list based on the available operators.
![](../__attachments/3865706579/image-20230407-133131.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
Most frequent value
This aggregate determines whether the value in the Most Frequent Value field occurs the most.
![](../__attachments/3865706579/image-20230407-183944.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
JSON object as a value
This is used to set a key with a JSON object as the value. You can set it or delete it.
Example call
![](../__attachments/3865706579/image-20230407-214113.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
Attribute in cache
![](../__attachments/3865706579/image-20230407-214604.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
JSON Real-Time decisions
The JSON Real-Time Decision is the decision rule to use when executing a rule against a JSON parameter (attribute).
After creating the new JSON Real-Time Decision rule, you can set the Visitor Parameter (attribute) that you expect the JSON object to be in.
Following that, you click the JSON Schema section on the right, and it will pop up a screen where you enter a sample of the JSON object that will be found in the parameter.
After doing this, when you select the Criterion, you will have elements in the criterion relative to the JSON object that was entered into the Schema section.
![](../__attachments/3865706579/image-20230410-134652.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
When you add a criterion, you will see a Custom JSON option, but then you will see additional criterion based on schema that was provided, like glossary.title
or glossary.GlossDiv.title
elements.
![](../__attachments/3865706579/image-20230410-135045.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
Here is a rule with the criterion based on glossary.title
. If Apply
filter is set to No
, then the rule will just look for the existence of that attribute in the JSON if the Aggregate
Function is set to Any
.
![](../__attachments/3865706579/image-20230410-135132.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
If the Aggregate
Function is set to Not Any
it will validate that no elements in the JSON contain glossary.title
.
![](../__attachments/3865706579/image-20230410-141453.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
If Apply
Filter is set to true
then you will be able to add potential values that the attribute value may be set to. In this example, we are evaluating if glossary.title
equals example glossary
.
![](../__attachments/3865706579/image-20230410-135457.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
Finally, if the element in the JSON object is an Array, then it will give you additional options for Aggregate
functions. Below is an example array of strings named Attribute List
and a numeric array named AttributeNumericList
.
"AttributeList": [
"green",
"white",
"blue"
]
"AttributeNumericList": [
1,
3,
5
]
This is an example of the Aggregate
function when using an array of strings.
![](../__attachments/3865706579/image-20230410-142814.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
This is an example of using an Aggregate
function when using an array of numeric values.
![](../__attachments/3865706579/image-20230410-143130.png?inst-v=c3007bf4-8f91-43d3-9633-90859273c945)
Aggregate function reference guide information
For more details on Aggregate
functions, refer to the RPI Reference Guide by looking up "JSON Realtime Decision".
Here is a copy of the information from the guide relative to Aggregate
functions, but we recommend that you refer to the Reference Guide for the most up-to-date information.
Aggregate function: a dropdown field, in which available values are presented alphabetically.
The following values are always available:
Any
(the default)Not any
The following additional value is available if the selected JSON element is an array or an attribute of an object in an array:
Count
The following additional values are only available at numeric JSON attributes:
Sum
Minimum
Maximum
Average
If a value other than Any
or Not Any
is selected, the following additional fields are displayed:
[Operator]
: set using a dropdown; defaults to=
.[Value]
: if the selectedAggregate
function isCount
, an integer field is supplied, otherwise a decimal field is used to specify the value. The property defaults to0
.
Update operator reference
0
- Set the Attribute
1
- Delete the Attribute
2
- Push To Array
3
- Pull from Array