Managing the collection of user data

How it works

During user registration, the following basic data is requested:

  • When using the Login API:
    • username
    • email
    • password
  • When using the Login widget:
    • email
    • password

You can request additional personal data from users. To do this, in your Publisher Account, specify which additional fields should be included in the registration form. User registration is possible only after filling in all the fields that you have marked as mandatory. The data provided by users is stored in their profiles in the database.

If, during authentication of a previously registered user, it is found that some fields in their profile are not filled in, the Login product will display a form to collect the missing information. To log in, the user needs to fill in all the required fields of this form.

How to get it

  1. Set up your Login project in Publisher Account.
  2. Send a request to your Customer Success Manager to include your custom fields to the user registration form (optional).
  3. Integrate the solution on the side of your application.

Setting up in Publisher Account

  1. Open your project in 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 Supplementary user information section.

  1. The following fields and checkboxes may be displayed in the user registration form:
    • Username.
    • First name.
    • Last name.
    • Birthdate.
    • Country.
    • Gender.
    • Newsletter — a checkbox that allows the user to subscribe to the newsletter. When the user checks the box, their contacts are automatically exported to Mailchimp if Mailchimp is connected to your project.
    • Additional agreement — a checkbox that enables the user to sign your additional agreement. You can obtain a list of users who have signed the additional agreement through Publisher Account or via the API method. The list will be available in the additional_agreement.csv file.

  1. To make a field mandatory, click the icon in the field description line. The icon will turn blue.
Note
To customize the texts of the Newsletter and Additional agreement checkboxes, follow the instruction.
  1. Click Save changes.

Request to add custom fields to registration form

In addition to the fields available in the Publisher Account, you can add your own fields to the registration form. To do this, contact your Customer Success Manager or email to csm@xsolla.com and provide the list of fields with the following information for each field:

  • field name in English;
  • type:
    • string;
    • date;
    • select — selecting one option from a list;
    • multi-select — selecting multiple options from a list;
  • whether the field is mandatory.

For select and multi-select fields, also provide your Customer Success Manager with sets of possible values for these fields.

Note
Xsolla storage does not support using custom fields in the user registration form.

Application side integration

If you have used the integration via the Login widget, no actions are required to integrate the extended registration form on the side of your application.

When integrating through the Xsolla SDK, collecting additional information about users is not yet available.

When integrating via the Login API, pass the collected additional user data in the Register new user request using the fields parameter. This parameter is a set of property-value pairs. The fields of the registration form that can be connected in the Publisher Account correspond to the following properties of the fields parameter:

Field name

Typefields parameter property
Usernamestringusername
First namestringgiven-name
Last namestringfamily-name
Birthdatedate (YYYY-MM-DD)bday
Countryselect (ISO 3166-1 alpha-2)country-name
Genderenum (with f and m values)gender
Notice
The Register new user request must pass the values of all required fields.
Example of the request:
Copy
Full screen
Small screen

http

  • http
  • curl
POST https://login.xsolla.com/api/user?login_url=https://example.com&projectId={projectId} HTTP/1.1
Content-Type: application/json

{
  "username": "john-email@email.com",
  "password": "123456",
  "email": "john-email@email.com",
  "fields": {
     "nickname": "John",
     "country-name": "US",
     "bday": "1997-07-16"
  }
}
curl --request POST \
  --url 'https://login.xsolla.com/api/user?login_url=https%3A%2F%2Fexample.com&projectId=projectId' \
  --header 'content-type: application/json' \
  --data '{"username":"john-email@email.com","password":"123456","email":"john-email@email.com","fields":{"nickname":"John","country-name":"US","bday":"1997-07-16"}}'

The options for adding fields to the registration form and the location for storing the collected information differ depending on the type of user data storage chosen:

Xsolla storage

If you use Xsolla storage, you can only add fields available in your Publisher Account to the registration form. The additional information collected from users is stored on Xsolla’s side.

PlayFab storage

If you use PlayFab storage, you can add both fields available in your Publisher Account and your own fields to the registration form.

Information about additional fields and their values are saved as user data in your PlayFab storage. You can access this user data through the PlayFab API or in your PlayFab account:

  1. Go to the Players section and click the user ID.

  1. Select the Player Data (Title) tab.

Firebase storage

If you use Firebase storage, you can add both fields available in your Publisher Account and your own fields to the registration form. The additional information collected from users is stored on Xsolla’s side.

Custom storage

If you use a custom storage, you can add both fields available in your Publisher Account and your own fields to the registration form.

Information about additional fields and their values are sent by the Xsolla Login server in the registration request to the URL that was specified in the New user URL field in the Publisher Account when connecting your custom storage.

Example:

The following fields are added to the user registration form:

  • country;
  • custom nickname field of string type;
  • custom platform field of multi-select type with possible values: windows, mac os, and linux.

During user registration, the Xsolla Login server will send the following request to the New user URL:

Copy
Full screen
Small screen

http

  • http
  • curl
POST https://your.hostname/new_user_url.path HTTP/1.1
Content-Type: application/json
Authorization: Bearer {JWT}

{
  "email": "john@gmail.com",
  "password": "123456",
  "country-name": "DE",
  "nickname": "JohnSnow",
  "platform": ["windows", "mac os"]
}
curl --request POST \
  --url 'https://your.hostname/new_user_url.path' \
  --header 'authorization: bearer_JWT' \
  --header 'content-type: application/json' \
  --data '{"email":"john@gmail.com","password":"123456","country-name":"DE","nickname":"JohnSnow","platform":["windows","mac os"]}'
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: March 12, 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!