Skip to main content
RichRelevance

Build: User Profile Batch Upload

Overview

The User Profile Batch Upload allows you to load data and update multiple user profiles simultaneously. It provides a way to store user attribute information. This can be used to load customer segment, attribute, or preference data into the User Profile Service. This data then becomes available for use with all of the Algonomy products.

When a batch file is processed, any existing data for a user in the new file is replaced with the data from the new file. Any users not contained in the file are untouched. 

Audience 

This topic covers one of the methods to input data to the User Profile Service and is appropriate for anyone considering the implementation of User Profiles in conjunction with their Omnichannel Personalization integration, as well as Algonomy employees, partners and users new to the User Profile Service.

Benefits 

By uploading a batch of users and user attributes, segments and preferences which you have already identified, you can start getting the benefit from the UPS more quickly.

How It Works 

The JSON data file is uploaded via FTP.

Batch File

File Format

The file is a simple JSON data file. You can upload the JSON data file as .txt, .csv, or .json file. Each individual object in the file will have two fields: ‘userId’ and ‘value’. 'userId' is the user profile to attach the data to, and 'value' is the JSON object that will be returned from that ID upon request.

Note: Only data uploaded as segments can be used in the dashboard segment builder and merchandising rules, user attributes can only be stored  in the UPS.

Here’s an example of what this may look like for user segment data. 

{“userId”: “13579”, “value”: {“seg2134″: ”Dog Owner”, “seg50plus”: ”High Spender”, “Platinum”: “Platinum Member”}}
{“userId”: “bob789″, “value”: {“seg345″: ”Cat Owner”}}
{“userId”: “jill456″, “value”: {“seg345″: ”Cat Owner”, ”silver”: ”Silver Loyalty Member”}}

Another example that loads data for user preferences would look like

{“userId”: “john123″, ”value”: {“like”: [“prod102710186″, ”prod102480209″, ”prod100800220″, ”prod101000082″], ”disLike”: [“prod10150001″, ”prod101010003″, ”prod00780″, ”prod102540091″, ”prod101910083″, ”prod101520076″]}}
{“userId”: “jill456″, ”value”: {“like”: [“prod102710186″,”prod102480209″], ”disLike”: []}}
{“userId”: “joe345″, ”value”: {“like”: [“prod102710186″], ”disLike”: [“prod102480209″]}}

Another example that loads data for user attributes would look like

{“userId”: “john123″, ”value”: {"haircolor": ["brown", "black"], "eyecolor": ["green"]}}
{“userId”: “jill456″, ”value”: {"haircolor": ["grey"], "eyecolor": ["blue"]}}
{“userId”: “joe345″, ”value”: {"haircolor": ["blonde"], "eyecolor": ["blue"]}}

Note: Each attribute type (attributes or preferences) must be loaded as a separate file into UPS.

Uploading the file

To upload the batch attributes into the User Profile, you need to load the file onto the Build FTP site and run the “UPSBATCH” operation. The “-attribute” argument is required to define the type of customer attribute that is being stored in the User Profile. For Algonomy applications to recognize these attributes properly, we have defined a few restricted attribute options. When uploading information that is utilized by another Algonomy application, please use the proper customer attribute option. An example would be for uploading customer segment information that can be used across applications. We assign “rr-segments” for it to be recognized and used by the relevant applications

ftp build-ftp.richrelevance.com 2222
put ~/sample_segments.txt sample_segments.txt
site upsbatch sample_segments.txt -attribute rr-segments

Each time a new file is uploaded for the same attributes and users, we overwrite the previous data associated with the users.

For example, assume you had originally provided user preference data to say User-A likes {product 1, product 2}. Then if in a subsequent update, you provide us User-A likes {product 3, product 4}, then the response from the User Profile Service would indicate User-A likes {product 3, product 4} and not {product 1, product 2}.

The restricted attribute options when uploading batch data are as follows:

rr-segments: Used to define a list of segments for each user

rr-userattributes: Used to define a list of user attributes for each user

rr-preferences: Used to define a list of user preferences for each user.

Each of these must be loaded as separate files into UPS.

Note: There is a configuration that needs to be enabled for batch uploads for UPS. Contact your Algonomy representative to enable this for you.

User Profile Response

When using the User Profile API to get data about a specific user, the batch uploaded data for that user is returned under a “batchAttribute” section, as shown in the example below.

"batchAttributes": {
    "john123": {
        "rr-segments": [
            {"seg123": "Dog Owner"},
            {"platinum": "Platinum Loyalty Member"}
        ],
        "rr-preferences": {
            'like': [prod102710186,prod102480209,prod100800220,prod101000082],
            'disLike': [prod10150001,prod101010003,prod00780,prod102540091,prod101910083,prod101520076]
        }
    }
}
  • Was this article helpful?