Attributes

Attributes allow you to update user properties dynamically. These can be used for user segmentation and targeting in your VWO campaigns.

set_attribute()

Use the set_attribute() method to set a custom attribute for a user:

# set attribute for a user
set_attribute_response = vwo_instance.set_attribute('attribute_key', 'attribute_value', { id: 'your_user_id'})

ParameterTypeDescription
attribute_key
Required
StringThe key of the attribute to set
attribute_value
Required
StringThe value of the attribute.
context
Required
hashContains information about the current user, including a required unique identifier for each user. Read more about userContext here .