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
  • transfer user information between different publishing platforms

There are 2 types of user attributes:

  • User-editable. The values for this type of attributes are entered by a user or specified according to the in-game logic on the client side. For example, the name and character stats, game difficulty level, etc.

  • Read-only. The values for this type of attributes are entered and edited on the server side of your application. We recommend that you use them for configuration of game character stats or user parameters that shouldn’t change regularly. For example, chance to get a bonus, game character key parameters, user categories, etc.

If needed, 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 pane of a Login project.
  3. Go to the User database block and select the User attributes schema section.

  1. Specify the attribute validation rules in JSON Schema format (optional):

Note
To enable personalization of your in-game store, add all user attributes to the JSON schema.

    • In the properties object, 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 object, 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 array, specify a list of required attributes.
    • Set the value of the type field to object.

Note
Each user attribute name is specified individually. Regular expressions, masking, and the patternProperties property are not supported.
If you do not specify the user attribute type in the JSON schema, the type field will default to the value data_type when updating the attribute.
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 application, use the following Login API methods to implement the logic of working with user attributes:

Note
When calling the Get user’s attributes from the server method, all user attribute values are returned as strings.

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 pane of a Login project.
  3. 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.
Last updated: September 18, 2024

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!