Recipes

This section provides guidance on configuring various loyalty programs by utilizing different loyalty features.

Configuring a Loyalty Program with Streaks

Example 1: Exercise 30 Minutes a Day / 5 Times a Week / 3 Weeks a Month

Assumption

The brand will send an event only once a day. The event will include an attribute that indicates how many minutes the user has exercised for that day.

Implementation Steps

1. Behavioural Event:

  • Event Creation:
    • Event Name: "Exercise"
    • Attributes:
      • Customer ID
      • Minutes Exercised (attribute name: "minutes")
    • Webhook Sharing:
      • Share the created webhook with the brand. The brand will push their entries into this webhook. Ensure the brand sends data in the correct format and schema.
      • Optionally, add an attribute called “eventDateTime” to the schema to override the current date with the desired date (useful for retroactive or future entries).
    • Event Frequency: The brand must send only one event per customer per day.

2. Streak Configuration:

  • Create a Streak:
    • Metadata:
      • Name: [Enter Name]
      • Description: [Enter Description]
      • Till Code: [Enter Code]
    • Date Settings:
      • Start Date: [Enter Start Date]
      • End Date: [Enter End Date]
    • Audience:
      • Eligibility:
        • All customers
        • Specific audience group
    • Target Level Configurations:
      • Activity: Behavioral Event
      • Event: “Exercise”
      • KPI: Count
      • Target Value: 5 (indicating 5 times a week)
      • Frequency: Weekly
      • Rule: currentEvent.minutes >= 30 (ensures only days with at least 30 minutes of exercise are considered)
    • Streak Level Configurations:
      • Streak Level: 3 (indicating 3 weeks)
      • Additional Levels: Add more levels if needed (e.g., 5 weeks, 7 weeks, 10 weeks)
      • Non-Continuous Option: Enable/disable based on whether the streak must be continuous or can include breaks.
      • Level Name: The name of the level can be found in the “info” icon at the end of each level’s row. This is important for writing rules in loyalty promotions.

3. Loyalty Promotion:

  • Create a Promotion:
    • Metadata:
      • Name: [Enter Name]
      • Description: [Enter Description]
      • Loyalty Program: [Link with the relevant loyalty program]
    • Customer Activity:
      • Select “Milestone or Streak is updated”
    • Promotion Type:
      • Choose one of the available options (usually “Available without issue”)
    • Duration:
      • Match the duration with the streak creation
      • Optionally add a few buffer days to the end date
    • Condition Setup:
      • In the rule-box, use a rule similar to: currentEvent.streakName == "name" && currentEvent.streakExists("name") && currentEvent.isStreakAchievedEvent
      • Replace "name" with the name of the streak level.
    • Actions:
      • Points: Use "Issue points" (previously “target point allocation”)
      • Alternate Currencies: Use "Issue {{name_of_AC}}"
      • Coupons: [Provide details if applicable]
      • Badges: [Provide details if applicable]
    • Save & Publish: Save and publish the promotion to make it live.

Example 2: Exercise 30 Minutes a Day / 5 Times a Week / 3 Weeks a Month

Assumption:
The brand sends an event each time the user exercises (more than once per day), and Capillary is responsible for summing the total exercise time. For example:

  • 10 minutes in the morning
  • 15 minutes in the evening
  • 20 minutes at night

Instead of sending a single event with a “minutes” attribute of 45, the brand sends three separate events with the corresponding attribute values.

Implementation Steps

1. Behavioural Event

  • Create a Behavioral Event:
    • Name the event (e.g., “exercise”).
    • Include necessary attributes such as customer ID and number of minutes exercised (attribute name: “minutes”).
  • Share Webhook:
    • Provide the webhook to the brand for event submission.
    • Ensure the brand sends data in the correct format.
  • Add eventDateTime Attribute:
    • Include this attribute in the schema to override the current date as needed for retroactive or future events.

2. Target Configuration

  • Create a Target:

    • Meta Details:
      • Name
      • Description
      • Till code
      • Start & end date: Cover the entire use case duration.
    • Audience:
      • All customers or a specific group.
    • Cycles:
      • Create daily cycles of fixed window type.
      • Set the start date to the use case start date and continue until the end date.
    • Target Activity Details:
      • Activity: Behavioral event
      • Event: “exercise”
      • KPI: SUM
      • Attribute: “minutes”
      • Target Value: 30 (total minutes per day)
      • Frequency: Daily
      • Rule: Leave as “true”
  • Save & Submit

3. Streak Configuration

  • Create a Streak:

    • Metadata:
      • Name
      • Description
      • Till code
    • Dates:
      • Start date: Same as the target start date.
      • End date: Same as the target end date.
    • Audience:
      • All customers or a specific group.
    • Target Level Configs:
      • Activity: “target completed event”
      • KPI: COUNT
      • Target Value: 5 (times per week)
      • Frequency: Weekly
    • Streak Level Configs:
      • Streak Level: 3 (weeks)
      • Additional Levels: Add more if needed (e.g., 5 weeks, 7 weeks, 10 weeks).
      • Non-Continuous: Enable or disable depending on whether the streak needs to be continuous or allow breaks.
      • Level Name: Found in the “info” icon at the end of each level’s row for use in rules.
  • Save & Submit

4. Loyalty Promotion

  • Create a Loyalty Promotion:
    • Metadata:
      • Name
      • Description
      • Loyalty program linkage
    • Customer Activity:
      • Select “Milestone or Streak is updated”
    • Promotion Type:
      • Choose from the available options, usually “Available without issue.”
    • Duration:
      • Match the duration to the streak creation.
      • Optionally, add buffer days to the end date.
    • Condition:
      • Write a rule such as:
        currentEvent.streakName=="name" && currentEvent.streakExists("name") && currentEvent.isStreakAchievedEvent
        
        Here, “name” refers to the streak level name.
    • Actions:
      • Points (use Issue points)
      • Alternate currencies (use Issue {{name_of_AC}})
      • Coupons
      • Badges
    • Save & Publish:
      • Make the promotion live.

Example 3: Use Case - Purchase $150 and Record 3 Basketball Sessions in a Week

Assumption:
Recording basketball sessions is considered a behavioral event.

Implementation Steps

1. Behavioral Event

  • Create a Behavioral Event:
    • Name: “basketball_session”
    • Include all necessary attributes (e.g., customer ID).
  • Share Webhook:
    • Provide the webhook to the brand for event submission.
    • Ensure the brand sends data in the correct format.
  • Add eventDateTime Attribute:
    • Include this attribute to override the current date as needed (useful for retroactive and future dates).

2. Unified Target Creation

  • Create the Unified Target:

    • Meta Details:
      • Name
      • Description
      • Till code
      • Start & end date: Cover the entire duration of the use case.
    • Audience:
      • All customers or a specific audience group.
    • Cycles:
      • Create weekly cycles starting from either a specific date or from the customer’s first activity post-enrollment, depending on the use case.
    • Target 1 Details:
      • Activity: Transaction
      • Entity: Transaction
      • KPI: Gross sales
      • Target Value: 150
      • Rule-box: Leave as “true”
    • Target 2 Details:
      • Activity: Behavioral event
      • Event: basketball_session
      • KPI: COUNT
      • Target Value: 3
      • Rule-box: Leave as “true”
    • Operator: Use “ALL” to require both targets to be met. If any one target is sufficient, use “ANY.”
  • Save & Continue

3. Loyalty Promotions

  • Create a Loyalty Promotion:

    • Metadata:
      • Name
      • Description
      • Loyalty program linkage
    • Customer Activity:
      • Select “Milestone or Streak is updated”
    • Promotion Type:
      • Choose the appropriate option based on the use case, typically “Available without issue.”
    • Duration:
      • Match the duration of the unified target creation.
      • Optionally, add a few buffer days to the end date.
    • Condition:
      • Add a condition such as:
        currentEvent.isUnifiedTargetAchievement
        
      • If rewards need to be given for individual targets as well as the unified achievement, add conditions for each target:
        currentEvent.isTargetAchieved && currentEvent.targetExists("name of the specific target")
        
    • Actions:
      • Points: Use Issue points (previously called “target point allocation”).
        • Select options based on whether rewarding is for the unified achievement or individual targets.
      • Alternate Currencies: Use Issue {{name_of_AC}}
      • Coupons
      • Badges
  • Save & Continue