Case Study - Gift Card Incentives

For this app, a project rewards participants with gift cards for completing survey tasks.

Architecture

The main components involved in this app are:

  • MyDataHelps Server - Triggers a webhook when a participant completes a survey task.
  • MyDataHelps App - Allows the participant to complete tasks, displays their points information, and allows them to initiate a gift card redemption.
  • Amazon Web Services (AWS) - Interacts with the MyDataHelps API and to award points. Receives redemption requests from MyDataHelps and issues gift cards.

Completing Tasks to Earn Points

When a participant completes a survey task, MyDataHelps activates a webhook monitored by an AWS Lambda. The Lambda then saves the participant’s points and progress by using MyDataHelps’s Device Data API (in the project data namespace).

Viewing Points and Progress

MyDataHelps uses the participant’s data to present a dashboard showing the participant their progress and points they have earned.

Redeeming Points for Gift Cards

When the participant has earned sufficient points, MyDataHelps will allow them to request a gift card redemption. Since MyDataHelps cannot communicate directly with AWS, some coordination is necessary.

  1. MyDataHelps uses the MyDataHelps API to store the redemption request (in the project data namespace).
  2. An AWS CloudWatch event is configured to run on a set schedule several times a day.
  3. The CloudWatch event triggers an AWS lambda.
  4. The Lambda then:
    • Uses the MyDataHelps API to query for participants that have requested gift card redemptions and verify that they have earned the requisite number of points.
    • Interacts with the Amazon Incentives API, which provides the ability to issue electronic gift card codes.
    • Updates the participant’s data using the MyDataHelps API to reflect the points they have redeemed and mark the redemption request as complete.
    • Triggers an AWS Simple Email Service to notify the participant of their gift card information.

Project Setup

For all of this to work, several things need to be configured in the MyDataHelps project:

  • Set up a service account for API access.
  • Set up a webhook so MyDataHelps can notify the Lambda when a task is completed.

Additionally, the project must set up and fund an Amazon Incentives account to utilize the electronic gift cards.