You can upload custom recommendations directly into Blueshift as recommendation feeds. The recommendations must be in the form of a CSV file. The following types of feeds are supported.

  • User to Product: Recommendations for each user can be imported using one of the user identifiers and one or more product_ids from the catalog. For example, include personalized promotions.
  • Product to Product: Recommendations that go from one product to others. For example, people who view or buy a product can consider these other products.

Data Format

After you prepare a CSV file that contains the recommendations data, you can then import it to Blueshift by creating an import feed.

  • The data for User to Product recommendations must include one of the following customer identifiers: email or customer_id
  • If multiple products are included, they must be separated by a delimiter.

You can also click the Download Sample CSV link in an import task and review its format to understand the type of file required. 

Sample Data for User to Product recommendations

email product_ids
testuser1@domain.com ITEM_0000 | ITEM_1111
testuser2@domain.com ITEM_222 | ITEM_333 | ITEM_5555

Sample Data for Product to Product recommendations:

source_product_id product_ids
ITEM_123 ITEM_234 , ITEM_345
ITEM_234 ITEM_123 , ITEM_345 , ITEM_456

Importing local file or from a S3 location

Upload CSV file to an S3 bucket

You can either upload the CSV file from the UI or you can upload the CSV file to an S3 bucket. You can use the S3 bucket provided by Blueshift (using the default adapter Blueshift Import) or to your custom S3 bucket (using the Custom Import adapter).

If you are using the Blueshift Import option:

  • Add data files to the folder customers/<site-name>/import/recommendations/feeds/.
  • You can obtain the S3 credentials from the Account Settings > API Keys tab. The credentials are visible only to users with an Admin role.

If you are using the Custom Import option:

  • Ensure that your S3 bucket has a CORS configuration.
  • Provide your own S3 credentials and S3 file path. For example,
    bucket: bsft-customers
    path: demosite.com/customer_attributes/import/crm_feeds.csv

Create a recommendation feed

Complete the following steps to set up a recommendation feed:

  1. To import recommendation data, go to Recommendations and then go to the Feeds tab.

    rec_feed_landing.png

  2. Click +CONTENT FEED
  3. Select the source data warehouse from which you want to import the feeds
    Screenshot 2024-09-12 at 2.28.34 PM.png
  4. Select Direct File Upload or Upload via S3 Bucket as the source, a modal presents

    feed_name.png

    • Add the Name for the feed.
    • Select the type of recommendation data as User to Product or Product to Product.
    • Add a Description.
    • Click OK.
  5. In the Import Form, select the Import Method as File Upload or S3 Upload.
  6. If you select File Upload, for Choose File, select the file to be uploaded.

    feed_fileupload.png

    Sample data from the file is uploaded. Go to Step 11 to Map Attributes.

  7. If you select S3 Upload as the source, for the Adapter, select one of the following options:
    • Select Blueshift Import if you are using the S3 bucket provided by Blueshift. 
    • Select Custom Import to use your own S3 location.

    feed_s3_custom.png

  8. If you select Blueshift Import, specify the S3 Path where you upload the customers data files. For example, you can create a location on the S3 bucket called customers/<site-name>/import/recommendations/feeds/SummerCampaign and upload files to this path.
  9. If you select Custom import, provide the access credentials for the S3 bucket. For more information, see Working with Amazon S3 buckets in the AWS documentation.
    • Access Key: The Access Key ID that we use to get files that contain your customers' data from your S3 bucket. 
    • Secret Access Key: The Secret Access Key that we use to get the files from your S3 bucket.
      For more information on the Access Key ID and Secret Access Key, see Programmatic access on AWS documentation.
    • Bucket: Provide the URL to your S3 bucket where you store the files. 
    • AWS Region: Specify the AWS region where the S3 bucket resides. 
    • S3 Path: Specify the path on the S3 bucket where you upload the files with your customers' data.
  10. Add the Update Frequency. You can select from Only once, Weekly, Daily, or Hourly.
  11. Click advanced to specify the character encoding of the CSV file you upload. You can select Unicode (UTF-8), Unicode (UTF-16), or Western Europe (ISO-8859-1).
  12. Click Fetch Sample S3 File to fetch sample data from the file. 
  13. Map columns from the CSV file to standard Blueshift columns (email, customer_id and product_ids).

    feed_mapattributes.png

  14. Specify the Field Separator (delimiter) for your product item list.
  15. Click Import Recommendations.

    You can view the task status from the Feeds index page.

    You will receive an email notification when the recommendations are uploaded. The email includes information for both processed and failed records.

Import from Data Warehouses

You can also import recommendation feeds from Data Warehouses that Blueshift connects to natively. 

Pre-requisite

Before you can import data from Data Warehouses you must setup integration with these warehouses. Currently Blueshift supports native integration with Snowflake, Databricks and Google Bigquery

Set up import task

  1. To import recommendation data, go to Recommendations and then go to the Feeds tab.

    rec_feed_landing.png

  2. Click +CONTENT FEED.
  3. Select the source data warehouse from which you want to import the feeds
    Screenshot 2024-09-12 at 2.28.34 PM.png
  4. Add a name for the import task that you are going to setup. Please note, this is not the name of Recommendation feed
    Screenshot 2024-09-12 at 2.29.37 PM.png
  5. Once you enter the task name, the import task setup form will open up
  6. In the Destination section on left pane add the following details
    Screenshot 2024-09-12 at 2.32.59 PM.png
    • Name for the feed.
    • Type of recommendation - User to Product or Product to Product.
    • Description.
  7. In the Source section, select the adapter that you want to use for the import task
  8. Select the table/view from which you want to import data
  9. Sample data consisting of 10 records is fetched from the table or view specified in the Source section. This data is displayed in the Configuration section
    Screenshot 2024-09-12 at 2.41.58 PM.png
  10. Map the fields from the imported data to the fields in Blueshift and specify the data type for the field
    Screenshot 2024-09-12 at 2.45.03 PM.png
    • For user to product recommendations at least one column must be mapped to one of the customer identifiers - email or customer_id. And one column must be mapped to product_ids
    • For product to product recommendations at least one column must be mapped to product_ids
  11. Click Test Run to test the mapping. A maximum of 10 records are fetched during this test run.
  12. Verify that the data mapping is done correctly. Edit the data mapping if required. Click Test Run again after you make the changes.
  13. For Additional Configurations, select the Type of Import.
    Screenshot 2024-09-12 at 2.47.10 PM.png
    • Select Full Import if you are importing bulk data. For a Full import, the entire data from the selected table or view is imported from Snowflake every time you run the import task.
    • Select Incremental Import to set up an incremental import task. Select the Diff Identifier for letting Blueshift know the cursor column to identify increments
  14. In the Schedule section, set the Start Time for the import task.

    snowflake_schedule.png
  15. To set up a recurring task, under Schedule select the Is it a recurring data import? option.
  16. Set the frequency using the Task executes every field. You can set the frequency in minutes, hours, days, weeks, or months. You cannot set an import frequency shorter than a day for a Full import.
  17. Click Save to save the task.
  18. Click Launch to run the import task.

View Feed Tasks

To view Feed Tasks, go to Recommendations and then go to the Feeds tab. Click the feed to view details for the task.

The table provides details on the data that was processed when the task ran.

  • The status can be Processing, Processed, or Failed.
  • Information about Total records, Processed records, and Errored records is also shown.
  • You can Download the data that was processed in CSV format and View more details.

Note: If there are errors in processing the fetched data, the status is still set as ‘Processed’

feed_import_result.png

Import errors and possible causes

It is possible that some records might not be imported due to errors. Here are a few errors that you may run into and the reasons why they might occur:

Firefly resource not found error=“{\“errors\“:[\“attribute_value_not_found\“]}”

An item in the product_ids list is not present in the catalog.

Firefly resource not found error=“{\“errors\“:[\“product_id_not_found\“]}”

The source_product_id itself is not the catalog.

 

Was this article helpful?
1 out of 1 found this helpful

Comments

0 comments

Please sign in to leave a comment.