User attributes

How it works

Attributes are user features that are stored as key-value pairs. With the help of the attributes you can:

  • segment users;
  • prepare personal storefronts for each group of users in your Web Shop.
To ensure integrity of transmitted data you can set attribute validation rules in JSON Schema format in Publisher Account. You can manage the attributes using the Login API methods or webhooks. You can also edit the attributes’ values in your Publisher Account.

How to get it

To set up user attributes:

  1. Open your project in your Publisher Account and go to the Login section.
  2. Click Configure in the panel of a Login project.
  3. On the navigation page, go to the User database block and select the User attributes schema section.

  1. Specify the attribute validation rules in JSON Schema format:
    • In the properties field, specify a set of user attributes and their properties. Allowed data types: string, number, integer, or boolean. The object’s depth: 1.
    • In the additionalProperties field, specify whether it is possible to create additional fields not listed in the properties object. Set the value to true if you want to allow additional fields or false to disallow.
    • In the required field, specify a list of required attributes.
    • Set the value of the type field to object.

JSON Schema example:

Copy
Full screen
Small screen
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "game": {
            "description": "Name of the game played by user.",
            "type": "string"
        },
        "age": {
            "description": "User's age.",
            "type": "integer"
        },
        "had_ban": {
                 "description": "Whether the user was banned.",
            "type": "boolean"
        },
        "last_purchase": {
                 "description": "Date of user's last purchase.",
            "type": "string",
        }
    },
    "additionalProperties": false,
    "required": [
        "age",
        "game",
        "last_purchase"
    ],
    "type": "object"
}

  1. On your website or in an application, use the following Login API methods to implement the logic of working with user attributes:

How to edit user attributes values

To edit user attributes values:

  1. Open your project in your Publisher Account and go to the Login section.
  2. Click Configure in the panel of a Login project.
  3. On the navigation page, go to the User database block and select the Users section.

  1. Find the user in the table and click Attributes in the corresponding string.

  1. In the pop-up window, select the attribute you want to edit, click on the pencil sign to edit the value, and click Save.

Was this article helpful?
Thank you!
Is there anything we can improve? Message
We’re sorry to hear that
Please explain why this article wasn’t helpful to you. Message
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.
Rate this page
Rate this page
Is there anything we can improve?

Don’t want to answer

Thank you for your feedback!
Last updated: May 20, 2022

Found a typo or other text error? Select the text and press Ctrl+Enter.

Report a problem
We always review our content. Your feedback helps us improve it.
Provide an email so we can follow up
Thank you for your feedback!