Skip to main content
A user profile is a representation of a user based on their behavior on your website or app. It’s used in conjunction with Algolia’s NeuralSearch and keyword search to personalize results.

How user profiles are built

Send accurate events to build relevant user profiles. Algolia requires events that describe how users interact with your app. For example, an online bookstore might track when users:
  • Click a specific book in a listing.
  • View the genre or author on the book’s details page.
  • Add the book to their cart.
  • Buy the book.
After receiving events, the Advanced Personalization feature applies various algorithms to your data (index and events). It identifies patterns and relationships within your data to predict user affinities. These affinities are used to create a user profile, which is continually updated with new information.
This feature isn’t available on every plan. Refer to your pricing plan to see if it’s included.

Schema

A user profile is represented in JSON format and includes a unique identifier for the user and their preferences (affinities).
JSON
{
  "userID": "user-1",
  "lastUpdatedAt": "2024-05-21T01:15:35Z",
  "type": "basic",
  "affinities": [
    {
      "name": "categories",
      "value": "Software",
      "indices": ["storefront"],
      "score": 18,
      "lastUpdatedAt": "2024-05-20T23:14:26.078071Z"
    },
    {
      "name": "color",
      "value": "Blue",
      "indices": ["storefront"],
      "score": 14,
      "lastUpdatedAt": "2024-05-21T01:15:08.590763Z"
    },
    {
      "name": "brand",
      "value": "Microsoft",
      "indices": ["storefront"],
      "score": 6,
      "lastUpdatedAt": "2024-05-21T01:15:35.465487Z"
    }
  ]
}

Properties

NameTypeDescription
userIDstringA unique string that identifies and tracks users across various systems.
lastUpdatedAtstringDate at which the user profile was last updated.
affinitiesarray of affinitiesProperties generated by Algolia’s Advanced Personalization feature to provide insights into the user’s preferences and interests.
They’re used to personalize the user’s experience on your website or app.

Affinity

NameTypeDescription
namestringName of the affinity.
valuestringValue of the affinity.
indicesarray of stringsNames of the Algolia indices associated with the affinity.
scorenumberStrength of the user’s preference for that affinity.
Each affinity has a score ranging from 1 to 20. A higher score signifies a stronger affinity.
lastUpdatedAttimestampDate of last update to this affinity.

See also