Skip to main content
RichRelevance

Segment Feed

Overview

Segments are groupings of users according to meaningful merchant-defined attributes like age, gender, demonstrated behavior, and spend. While RichRelevance Engage can be used to create and manipulate segments directly, Recommend does not incorporate that functionality. However, Recommend can accept and use already-existing segment data from the merchant. This document describes the feed format and process for providing that data to RichRelevance.

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 RichRelevance 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 RichRelevance system as a concatenation of a segment ID and a segment name. Each thusly 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 RichRelevance team may ask for keys to be kept inside of three or four characters.

Example

{"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.