Search through more than a hundred articles on every aspect of User.com

Alina Shafikova
Written by Alina Shafikova

How to create custom attributes

Adjust your database to your business needs


Why use custom attributes?

Every business is different. In each industry, different information about the user is key to understanding his or her needs. This is why you should create your own custom attributes. This simple process will help you leverage your marketing efforts.

How to create a custom attribute

To create a new attribute with a fixed type, go to "Settings"-> "App settings" -> "User data & events" -> "User attributes" and click "Create". You will be redirected to a page where you can choose the data type, name, and description of your new custom attribute.

  • boolean - for example: true / false
  • fixed choices - for example: English/Polish/Russian/Spanish
  • string - for example: "this is a sample string, just a regular text line"
  • date - for example: 2016-08-03
  • datetime - for example (ISO 8601 format): 2016-08-03 12:00:00+00:00
  • integer - for example: 23
  • floating-point number - for example: 24.5

Remember: If you want to use those attributes with our widget, you'll need to create them first, then use them in window.civchat object on your website. Otherwise, the widget will create new attributes itself with the string type:

  • Name: set the name of your new attribute.
  • Value type: from the menu, choose which type you want to use for your new attribute.

Edit your code with window.civchat object to match this:

<script>window.civchat = {
    apiKey: 'YOUR_API_KEY',
    email: 'johndoe@mydomain.com',
    test_boolean: true,
    test_integer: 4923,
    test_date: '2016-08-03',
    test_string: "Casual string with some number like 1094",
    test_dateandtime: '2016-08-03 11:49'
  };
</script>

You should be set and ready to go with new attributes!

Categories: