Segment Feed

Overview

Segments are groupings of users according to meaningful merchant-defined attributes like age, gender, demonstrated behavior, and spend. Algonomy Engage can be used to create and manipulate segments directly, however, if a retailer already has a library of segments built, they can use the Segment Feed to load them. Algonomy Recommend can also use segments loaded this way.

This document should be used in tandem with the Segment feed page in our developer documentation. Using the Segment Feed is easier than manually adding each segment because it automates the process.

When using feeds, it is essential that all the required files are included and that you ensure that all the required pieces of information are included.

Feed files are sent to Algonomy and then processed to populate the information into the database to power Engage content and recommendations.

Segments

Segments are accepted from clients in one of two ways:

  • They can be created in the Dashboard and triggered via the JavaScript tags.

  • They can be sent to us via a feed, where the segment data will be saved to the UPS and associated with user IDs.

These two approaches are quite different and require unique additional consideration before choosing one or the other. I will go into detail below.

Creating segments in the Dashboard and triggering them via tags

When segments are created in the Dashboard, they will not be associated directly with user IDs, and therefore, unless they are provided in the JavaScript tags, we will have no way of knowing to whom they apply. Therefore, an additional step is necessary. The segments need to be included in the tags to keep it all connected. This is done using the R3_COMMON.addSegment()tag. Here is the syntax:

R3_COMMON.addSegment('SEGMENT ID', 'SEGMENT NAME');

Just add that to the instrumentation on all pages to connect user IDs to segments properly.

Sending in segments via feed

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.

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. Here is an example:

{
    "seg123":"DogOwner"
}

One thing to keep in mind is that the segment feed is very resource-intensive, and it must be approved by Engineering before it can be offered to the client as a viable method of getting segments.