Send query results to Koupon Media

Koupon Media provides a platform that enables brands and retailers to launch data-driven campaigns that combine loyalty programs and mobile offers for their most valuable customers.

You can associate records in Amperity to the following Koupon Media channel types :

  1. Web application channels

  2. Mobile application channels

  3. SMS channels

  4. Email channels

  5. Social channels

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

  1. Build a query

  2. Add orchestration

  3. Run orchestration

Note

Koupon Media must be enabled before you can configure an orchestration to send query results. Ask your DataGrid Operator or Amperity representative to enable Koupon Media for your tenant.

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 Koupon Media. Data shaping is typically required only one time.

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, 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 channel

Important

The output sent to Koupon Media can vary, depending on the channel for which the data is being used and if any data from other data sources are appended or joined to the output.

A query sent to Koupon Media will result in defining a mapping of fields in Amperity to the fields required by the channel to which the query is sent. These mappings are similar to:

SELECT
  amperity_id AS ROW_ID
  ,given_name AS FST_NAME
  ,surname AS LST_NAME
  ,address AS ADDR_LINE_1
  ,address2 AS ADDR_LINE_2
  ,city AS CITY_NAME
  ,state AS STATE_PROVINCE_CD
  ,postal AS POSTAL_CD
  ,phone_mobile AS CELLNAME
  ,'' AS CUSTOMFIELD1
  ,'' AS CUSTOMFIELD2
  ,'' AS CUSTOMFIELD3
  ,'' AS CUSTOMFIELD4
  ,'' AS CUSTOMFIELD5
  ,'' AS CUSTOMFIELD6
  ,'' AS CUSTOMFIELD7
  ,'' AS CUSTOMFIELD8
  ,'' AS CUSTOMFIELD9
  ,'' AS CUSTOMFIELD10
  ,'' AS CUSTOMFIELD11
  ,'' AS CUSTOMFIELD12
  ,'' AS CUSTOMFIELD13
  ,'' AS CUSTOMFIELD14
  ,'' AS CUSTOMFIELD15
  ,'' AS CUSTOMFIELD16
  ,loyalty_id AS CUSTOMFIELD17
  ,'' AS CUSTOMFIELD18
  ,'' AS CUSTOMFIELD19
  ,'' AS CUSTOMFIELD20
from TableName

where ‘’ AS CUSTOMFIELDx adds the field required by the Koupon Media data structure, but without mapping it to a field and where, for example, loyalty_id AS CUSTOMFIELD17 shows mapping the loyalty ID for customers to a field in Koupon Media.

Tip

The types of data that may be sent to Koupon Media from Amperity include, but are not limited to, any of the types of data that are listed in the Koupon Media privacy policy , such as phone numbers, email addresses, clickstream data, and so on. As a general guideline, data sent from Amperity should comply with this policy.

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.

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 Koupon Media.

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

  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 Koupon Media 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”.