Update an Offline Purchases Dataset

You can update an Offline Purchases dataset via the Data API, using SFTP, or through the Upload Data wizard in the Monetate platform.

You can only add the optional sku and store_id attributes to an Offline Purchases dataset through a full update.

When using the Upload Data wizard to update an Offline Purchases dataset, you can either drag and drop a file directly into the wizard, or you can input a URL to a dataset file that you store on Amazon S3. Regardless of which of these two upload options you select, the file that you use must be in the CSV or TSV format.

Uploading a File Directly

Follow these steps to update an Offline Purchases dataset by uploading a dataset file directly to the Monetate platform using the Upload Data wizard.

  1. Click DATASETS in the top navigation bar, and then, if necessary, select Product Data.
  2. Select Offline Purchases from View on the Datasets list page.

    Callout of the View selector on the Datasets list page. One of the options is Offline Purchases.

  3. Find the Offline Purchases dataset that you want to update, click the upload icon for its entry, and then select Data File Upload.

    Callout of the upload icon and the 'Data File Upload' option for a dataset entry on the Offline Purchases view of the Datasets list page

  4. Select the type of update you want to perform, and then click NEXT.

    Step 1 of the Update Data wizard, with 'Partial Update' selected and a callout of the NEXT button

  5. Select Manual File Upload and then click NEXT.

    Step 2 of the Update Data wizard, with 'Manual File Upload' selected and a callout of the NEXT button

  6. Drag and drop the file into the wizard.

    Step 3 of the Update Data wizard, with a callout of the drag-and-drop field

  7. Click FINISH after the file is uploaded.

    Step 3 of the Update Data wizard, with the 'Upload Complete' message in the drag-and-drop field. The FINISH button is called out.

When the Offline Purchases view of the Datasets list page loads, PENDING appears in the LAST UPDATED column for the dataset.

On the dataset's details page, PENDING appears where the timeframe of the last update normally appears as well as in the UPLOAD DATE column of the Current Updates table.

An Offline Purchases dataset's details page, with a callout of the 'PENDING' status below the 'UPLOAD DATA' button and in the 'UPLOAD DATE' column of the 'Current Updates' table

If the file failed to upload or the platform encountered other errors, you see messages indicating the problem. See Failed Updates in this documentation for more information.

Uploading a File Using an Amazon S3 URL

Follow these steps to add rows to or update existing rows in a product catalog by uploading a dataset file using an Amazon S3 pre-signed URL.

  1. Generate the pre-signed URL for the file you want to upload.

    Refer to Sharing objects using presigned URLs in the Amazon Simple Storage Service (S3) user documentation for more information about generating a URL for this purpose.

  2. Click DATASETS in the top navigation bar, and then, if necessary, select Product Data.
  3. Select Offline Purchases from View on the Datasets list page.

    Callout of the View selector on the Datasets list page. One of the options is Offline Purchases.

  4. Find the Offline Purchases dataset that you want to update, click the upload icon for its entry, and then select Data File Upload.

    Callout of the upload icon and the 'Data File Upload' option for a dataset entry on the Offline Purchases view of the Datasets list page

  5. Select the type of update you want to perform, and then click NEXT.

    Step 1 of the Update Data wizard, with 'Partial Update' selected and a callout of the NEXT button

  6. Select Upload File Using Pre-signed S3 URL, and then click NEXT.

    Step 2 of the Upload Data wizard, with 'Upload File Using Pre-signed S3 URL' selected and a callout of the NEXT button

  7. Paste the Amazon S3 URL into the field, and then click FINISH.

    Step 3 of the Upload Data wizard, with a callout of the Amazon S3 presigned URL input field and the FINISH button

The Upload Data wizard closes and Monetate ingests the file. When the Offline Purchases view of the Datasets list page loads, a message briefly appears that informs you that the file was successfully uploaded from the Amazon S3 URL. Additionally, PENDING appears in the LAST UPDATED column for the dataset.

On the dataset's details page, PENDING appears where the timeframe of the last update normally appears as well as in the UPLOAD DATE column of the Current Updates table.

An Offline Purchases dataset's details page, with a callout of the 'PENDING' status below the 'UPLOAD DATA' button and in the 'UPLOAD DATE' column of the 'Current Updates' table

If the file failed to upload or the platform encountered other errors, you see messages indicating the problem. See Failed Updates in this documentation for more information.

Via SFTP

You can perform both full and partial updates to an Offline Purchases dataset using SFTP. In addition to CSV and TSV files, you can upload Gzip (.gz) and ZIP (.zip) files via SFTP.

You can only use the .gz file extension for a Gzip file. Monetate doesn't accept files with the .gzip file extension.

Setting Up Automatic Updates

To set up automatic updates for an Offline Purchases dataset, add the following information to your SFTP client.

  • Hostsftp://sftp.monetate.net
  • Port22
  • ProtocolSFTP

The username and password you can find within Monetate by selecting Sites from the settings cog in the platform.

Callout of the Sites option in the platform settings menu

From that same page you can create new SFTP credentials or change an existing SFTP user password. See Manage SFTP Users for more information.

You must have the Administrator role in the Monetate platform to set up SFTP users in the platform settings.

File-Drop Directories and Naming Conventions

There are two file-drop directories:

  • /datasets/full — Use this location for full file updates
  • /datasets/partial — Use this location for partial file updates

Follow this format when naming an update file: {datasetid}-examplefilename.csv

Replace {datasetid} with the unique ID for the Recommendations dataset you're updating. You can find this information in the platform by following these steps:

  1. Click DATASETS in the top navigation bar, and then, if necessary, select Product Data.
  2. Select Offline Purchases from View on the Datasets list page.

    Callout of the View selector on the Datasets list page. One of the options is Offline Purchases.

  3. Find the Offline Purchases dataset that you want to update, click the upload icon for its entry, and then select SFTP Info.

    Callout of the upload icon and the 'SFTP Info' option for a dataset entry on the Offline Purchases view of the Datasets list page

  4. Scroll to the bottom of the page to find the dataset ID.

    Callout of the required dataset ID prefix that must appear at the beginning of an update file's name

You must use a hyphen (–) between the dataset ID and the filename. The upload or update will fail if the dataset ID and filename are not separated by a hyphen.

You can change the portion of the filename that follows the hyphen from update to update. However, you cannot change the dataset ID.

Once you upload a file to the platform's SFTP server, it automatically updates the dataset.

Monetate retains dataset files for 180 days from the date it was uploaded. During this time you can download files successfully uploaded to the platform as well as files that resulted in one or more upload errors from a product catalog's Update History tab. Once a file is out of this retention period, it still appears on the Update History tab of the dataset's details page, but you cannot download it.

Failed Updates

If the platform encounters an error with the update, you see UPDATE FAILED in multiple places within the platform:

  • In the LAST UPDATED column for the dataset's entry on the Offline Purchases view of the Datasets list page

    Callout of the 'UPDATE FAILED' status for an Offline Purchases dataset on the Offline Purchases view of the Datasets list page

  • In place of the last update's timeframe on the dataset's details page

    Callout of the 'UPDATE FAILED' status on an Offline Purchases dataset's details page

In the UPLOAD DATE column of the Update History table, the exact date and time of the failed update appears in red.

Callout of the exact date and time that an update failed that appears in the 'UPLOAD DATE' column of the Update History table on an Offline Purchases dataset's details page

Click that text to view the File Upload Error modal containing the reason(s) for the failure.

Example of the 'File Upload Error' modal.

Refer to Dataset Specifications in the Offline Purchases dataset overview to ensure the update file conforms to the criteria for this type of dataset.