Algolia

Overview

Algolia is a search and discovery platform that enables personalized search results and product recommendations. The Algolia Personalization API allows you to associate user segment memberships with Algolia user profiles to tailor search and recommendation experiences.

Integrating Lytics with Algolia enables bidirectional synchronization between the two platforms. You can import Algolia user profiles, affinities, and segments into Lytics to enrich behavioral profiles and build audiences. You can then export Lytics audiences back to Algolia to personalize search results and product recommendations in real time.

Authorization

Before setting up the integration, ensure you have:

  • An Algolia application configured in the appropriate region (US or EU).
  • An Algolia API Key with search, browse, and recommendations permissions.
  • Access to the Lytics Authorizations page.
  1. Select Algolia from the list of providers.
  2. Select the Full Auth method for authorization.
  3. Enter a Label to identify your authorization.
  4. (Optional) Enter a Description for further context on your authorization.
  5. Enter your Algolia Application ID.
  6. Enter your Algolia API Key. The credentials will be validated on save — if a validation error is returned, verify your credentials and retry.
  7. Click Save Authorization.

Import User Data from Algolia

Import Algolia user profiles, affinities, and segments into Lytics to enrich user profiles and build behavioral audiences powered by Algolia personalization data.

Integration Details

  • Implementation Type: Server-side Integration.
  • Implementation Technique: Algolia Personalization API → Lytics profile stream.
  • Frequency: Initial full import (optional date filter) + continuous hourly sync as a Batch Integration.

Each run of the import job proceeds as follows:

  1. Queries the Algolia Personalization API for user profiles (paginated).
  2. Extracts user identifiers, affinities (name, value, score), segments (ID, source), and the last updated timestamp.
  3. Transforms the data into Lytics user profile fields.
  4. Writes the data into a Lytics user stream to enrich profiles.

Fields

The following fields are imported from Algolia into Lytics user profiles:

Algolia FieldLytics User FieldDescriptionType
userIDalgolia_user_idAlgolia User IDstring
typealgolia_user_typeAlgolia User Typestring
affinities[].namealgolia_affinities_nameAffinity Names[]string
affinities[].valuealgolia_affinities_valueAffinity Values[]string
affinities[].scorealgolia_affinities_name_score, algolia_affinities_value_scoreAffinity Scores by Name and Valuemap[string]float
segments[].idalgolia_segment_idsAlgolia Segment IDs[]string
segments[].sourcealgolia_segment_sourcesAlgolia Segment Sources[]string
lastUpdatedAtalgolia_last_updatedLast Updated Timestampdate

Configuration

Follow these steps to set up an Import User Data job for Algolia.

  1. Select Algolia from the list of providers.
  2. Select the Import User Data job type from the list.
  3. Select the Authorization you would like to use or create a new one.
  4. Enter a Label to identify this job in Lytics.
  5. (Optional) Enter a Description for further context on your job.
  6. Go to the Jobs page and search for the Algolia Import job.
  1. Create an instance of the Import job and configure it using the authorization created above.
  1. In the Start Date field, enter a date to limit which users are imported. Only users with a last_updated_at value on or after this date will be imported. Leave blank to import all users.
  2. Check the Keep Updated checkbox to continuously sync new and updated users from Algolia every hour.
  1. Click Complete to create the job. The job will initially enter a sleeping state while Lytics creates the required fields and mappings in the background.
📘

After the job is created, navigate to the Versions page to preview the fields and mappings generated by this job. You must create and publish a new version before the job can run. Once published, return to the job status page and click Pause then Resume to start the import.

  1. To verify the job is running correctly, scroll to the Metrics section on the job status page. This shows the number of users imported and any error logs.

Use Cases

Audience Building and Segmentation

Use the imported Algolia fields to build Lytics audiences based on user affinities and segment memberships. For example, create an audience of users who have a search affinity toward a specific product category.

Export Audiences to Algolia

Send Lytics audience memberships to Algolia to personalize search results and product recommendations. As users enter or exit selected Lytics audiences, their Algolia user profile is updated with the corresponding segment associations in real time.

Integration Details

  • Implementation Type: Server-side Integration.
  • Implementation Technique: API Integration, Audience Trigger Integration.
  • Frequency: Real-time Integration.
  • Resulting data: Lytics audience segment memberships are written to Algolia user profiles via the Algolia Personalization API (Beta).

Once the export is started, the job:

  1. Detects a user entering or exiting a configured Lytics segment.
  2. Maps the Lytics user ID to the configured Algolia user ID field.
  3. Retrieves the existing Algolia user profile for that user.
  4. Merges segment memberships: adds new Lytics audience slugs on entry, removes them on exit (if configured), and preserves any Algolia segments not managed by Lytics.
  5. Sends the updated segment list to the Algolia Personalization API.

Fields

Lytics FieldAlgolia FieldDescription
User ID FielduserIDThe Lytics profile field used to match the Algolia user
Segment Slugsegments[].idLytics audience slug written as an Algolia segment ID
Segment Membershipsegments[] arrayFull list of Lytics-managed segments on the Algolia profile

Configuration

Follow these steps to set up an Export Audiences job for Algolia.

  1. Select Algolia from the list of providers.
  2. Select the Export Audiences job type from the list.
  3. Select the Authorization you would like to use or create a new one.
  4. Enter a Label to identify this job in Lytics.
  5. (Optional) Enter a Description for further context on your job.
  6. From the Audiences list, select the Lytics audiences to export. As users enter or exit the selected audiences, their Algolia profile will be updated.
📘

Select audiences whose users have an algolia_user_id value. Users without a valid Algolia user ID in the mapped field will be skipped and will not update Algolia.

  1. From Trigger Events, select when to send updates: Entry only, Exit only, or Both.
  2. From the Region dropdown, select US or EU to match your Algolia application's region.
  3. From the User ID Mapping field, confirm the Lytics profile field that contains the Algolia user ID. This field is pre-populated and should not need to change.
  4. Click Start Export.

Segment Merging Behavior

When a user's segment membership is exported to Algolia:

  • Existing Algolia segments linked to the user are read first.
  • Lytics-managed segments are added or removed based on the trigger configuration.
  • Segments on the Algolia profile that were not created by Lytics remain unchanged.

Troubleshooting

Common Issues

IssuePossible CauseResolution
Export not syncingInvalid or missing Algolia user ID mapping in LyticsVerify the User ID Mapping field and ensure users have valid algolia_user_id values
Export missing segmentsUser not in the selected segment, or exit trigger not configuredConfirm segment configuration and trigger event settings
Import incompleteStart date filter is excluding users, or continuous sync is not enabledAdjust the start date or enable the Keep Updated checkbox
Authentication errorsAPI key lacks required permissions or the wrong region is selectedEnsure the API key has search, browse, and recommendations permissions, and that the region matches your Algolia application

Verification Steps

  1. Check the job status in Lytics under the Metrics tab for import/export counts and error logs.
  2. Validate your Algolia credentials: Application ID and API Key.
  3. Review job logs for errors or warnings.
  4. Confirm connectivity to the Algolia API.
  5. Verify that data appears in Lytics profile fields and in Algolia user profiles as expected.