Send query results to Bluecore

Bluecore is a marketing technology company that intelligently connects casual shoppers to products with the goal of transforming those casual shoppers into lifetime customers.

This topic describes the steps that are required to send CSV files to Bluecore from Amperity:

  1. Build a query

  2. Add orchestration

  3. Run orchestration

Note

Bluecore must be enabled before you can configure an orchestration to send query results.

Build query

You may need to build a query that shapes the data so that fields in the output are mapped to the fields required by Bluecore. Data shaping is typically required only one time.

Note

Do not include credit card information in results that are sent to Bluecore.

You can do this in the following ways:

  1. Add a SQL table (using Spark SQL) to the customer 360 database that selects PII fields from the Customer 360 table, along with any other fields Bluecore requires, and then outputs them to a table with columns that map to the required naming patterns.

    Note

    PII fields may require SHA-256 hashing or conversion to a UUID using the CAST() function.

  2. Add a SQL query (using Presto SQL) that filters within the query, and then outputs results that map to the required patterns.

    Note

    PII fields may require SHA-256 hashing or conversion to a UUID using the CAST() function.

The correct approach here depends on the data and the desired use case (or cases) for downstream workflows.

Map to Bluecore platform

Review the data type requirements for the Bluecore platform to verify all of the requirements for sending query results to Bluecore. The following sections show an example of sending data to Bluecore using the purchases data type.

Purchases query

The purchase data type requires the following fields:

  • order_id, which is the unique ID for the purchase

  • email, which is the unique ID used within the Bluecore platform

  • created, which identifies the date of the purchase, in one of the following patterns: “MM/DD/YYYY HH:MM” or “YYYY-MM-DDTHH:MM:SS”.

  • total, which identifies the sum of the purchase price for all products, including taxes, in the number format without commas and currency symbol

  • products, which identifies the product ID for each product bought as part of the purchase, separated by a pipe ( | ) character

Add a SQL table with a SELECT statement similar to:

SELECT
  amperity_id
  ,order_id AS order_id
  ,LOWER(email) AS email
  ,order_date AS created
  ,order_total AS total
  ,ARRAY_JOIN(ARRAY_AGG(product_id), '|') AS products
FROM
  Customer360
LIMIT 1000

Add orchestration

An orchestration defines the relationship between query results and a destination, including the location to which those query results will be sent and the frequency at which the orchestration will be run.

Important

Bluecore requires a header row to be present in CSV files. The header row cannot start with a number or contain any special characters other than underscores ( _ ) and must be less than 30 characters in length.

To add an orchestration

  1. From the Destinations tab, click Add Orchestration. This opens the Add Orchestration dialog box.

  2. From the Object Type drop-down, select Query.

  3. From the Object drop-down, select the query for which results will be sent to Bluecore.

  4. From the Destination drop-down, select a destination that is configured for sending data to Bluecore.

  5. From the Data Template drop-down, select a data template.

  6. Verify all settings.

  7. Set the workflow to Manual. (You can change this to automatic later, after verifying the end-to-end workflow.)

  8. Click Save.

Run orchestration

Run the orchestration manually to validate that it works.

To run the orchestration

  1. From the Destinations tab, under Orchestrations, open the    menu for the Bluecore orchestration, and then select Run.

  2. The Status column for the orchestration will update to say “Waiting to start…”, after which the notifications pane will update to include a notification that shows the current status.

  3. When the orchestration has run successfully, the status is updated to “Completed”.