Skip to main content

Segment Feed


Segments are groupings of users according to meaningful merchant-defined attributes like age, gender, demonstrated behavior, and spend. Both Recommend and Engage make use of segments in determining recs and content. Merchants can provide their pre-defined segments via a feed and this document describes that feed format and process for providing that data to Algonomy.

This segment feed does not need to be uploaded daily; it should be uploaded only when there are changes or updates to the segment data. This is usually scheduled to happen on a regular basis, be it weekly, monthly, or another suitable interval. This can also be done on an individual basis via API or Javascript tags. Please talk with your Algonomy representative if you think you would like to do this. You can also read more about this here, in the Feature Integration section.

segment is defined within the Personalizarion Cloud system as a concatenation of a segment ID and a segment name. Each thus defined segment is unique.

Unlike catalog and content feeds, which use pipe-delimited csv file formats with .txt extensions, segment feeds are sent to us as JSON data. Segments are passed in with user IDs in a JSON object consisting of two items: the user ID and the associated values for it. The associated values are held in another object, which is a list of hashes composed of the segment ID and name.

  • Segment ID: this is the ID of the segment.
  • Segment name: this associates the segmentID with a human-readable name. This is optional. If you don't have a segment name to pass in, pass in an empty string ("") in its place.

Example: "seg123":"DogOwner" 

The segment ID and name are unique. After you've set "seg123" to "DogOwner" it cannot be associated with another segment name.

With the User Profile Service, we now can load segments for each user via the User Profile batch upload process. In the User Segment file you associate user IDs with the segments they belong to. This can then be used to update the user information in the User Profile Service. The file format is given below, and for more information on the batch upload process please click here.

Feed File

Edit section
Feed File Details Filename pattern
Segment Feed A JSON-formatted data file of segment data for your site. segments_sitename_YYYY_MM_DD.txt

File Specifications

The feed file requires one JSON object per line. The object will contain two fields:

Name Type Required? Definition
userId ASCII Yes A unique identifier for the user.
value text Yes A valid JSON object that gives the unique segment identifiers and the human-friendly name of each segment for the individual user as a key: value pair. The segment value can be a string or a numeric value.

Keys in this object may be required to conform to a maximum number of characters, depending on the total size of the segment data (which is strongly correlated to the number of records). So for example, if there are a large number of records to ingest, then your Algonomy team may ask for keys to be kept inside of three or four characters.


{"userId": "13579", "value":{"seg2134":"Dog Owner", "seg50plus":"High Spender", "Platinum": "Platinum Member"}}

Note: Each unique segment identifier is meant to have a unique context or value.

To upload the file, follow the basic FTP Instructions found here in the section titled "Upload the file."

  • Was this article helpful?