Attributes
Setting attributes with code
One way to send attributes to Formbricks is in your code. In Formbricks, there are two special attributes for user identification(user ID & email) and custom attributes. An example:
Setting Custom User Attributes
You can use the setAttribute function to set any custom attribute for the user (e.g. name, plan, etc.):
formbricks.setAttribute("Plan", "Pro");
Generally speaking, the setAttribute function works like this:
formbricks.setAttribute("attribute_key", "attribute_value");
Where attributeName
is the name of the attribute you want to set, and attributeValue
is the value of the attribute you want to set.