LogoLogo
HomepageCase studiesBook a demo
User Guide
User Guide
  • Welcome to Open Loyalty!
  • What's New
    • 2024
    • 2023
    • 2022
  • What's Next
  • Technical Guide
  • Main Features
    • Global Management
      • Analytics
      • Settings
      • Config Duplication
      • Usage
    • Dashboard
      • General Overview
      • Units Wallet Overview
      • Additional Metrics
      • Members by Tiers
    • Members
      • Member List
        • Configuration
        • Creating Members
        • Managing Members
        • Removing Members
      • Segments
        • Creating Segments
        • Managing Segments
        • Segment Conditions
      • Referred Members
    • Campaigns
      • Creating Campaigns
        • Return Campaign
        • Referral Campaign
        • Time-Based Campaign
        • Redemption Code Campaign
        • Internal event - Achievement progressed
        • Percent value distribution
      • Managing Campaigns
      • Campaign Simulation
      • Follow-up Campaigns
    • Custom Events
      • Custom Event Schemas
    • Transactions
      • Adding Transactions
      • Managing Transactions
      • Channels
    • Tiers
      • Adding Tiers
      • Managing Tiers
      • Tiers Configuration
      • Tier Benefits
    • Wallets
      • Wallet Types and Configuration
      • Unit Transfers
        • Creating Unit Transfers
        • Importing Unit Transfers
        • Managing Unit Transfers
    • Achievements
      • Creating Achievement
      • Managing Achievements
      • Follow up Achievements
    • Rewards
      • Reward List
        • Rewards Configuration
        • Creating Reward
        • Reward Types
        • Units Conversion Coupon
        • Adding Coupons
        • Reward Flow
      • Reward Fulfillment
      • Reward Categories
    • Webhooks
      • How to Configure a Webhook
      • What Triggers a Webhook
      • Expiring Notifications
    • Collections
    • Imports / Exports
      • Imports
        • Sample Import Files
      • Exports
        • UI Data Exports
        • Configuration Exports
        • S3 Bucket Exports
    • Settings
      • Roles
      • Admins
        • System Logs
      • Tenants
      • Translations
    • Expressions
      • Attributes List
      • Operators
      • Custom Functions
      • Expression Examples
      • Sample Use Cases
        • Using Member Custom Attributes
        • Complex Effects (if, else)
        • Excluding Members
        • Elapsed Time Conditions
        • Using Additional Dates for Calculations
        • Register on Birthday
        • Transaction on Birthday
        • Tier Upgrade or Downgrade
  • Sample Setups
    • Good Practices
    • Pay with Points
    • Promo and Discounts in Cart
    • Sample Campaigns
      • #1 Earn 1 point for every $1 spent
      • #2 Earn 2x points when shopping on Monday morning
      • #3 Earn 1 stamp for every transaction
      • #4 Buy product ACME 123 and earn 100 points
      • #5 Refer a friend and get 100 points
      • #6 Refer 5 friends and get a $50 off coupon for the next purchase
      • #7 Register to the program and get 50 bonus points
      • #8 Get 30 bonus points for your first transaction in the loyalty program
      • #9 Cashback campaign
      • #10 Product meets selected criteria
    • Sample Achievements
      • #1 Celebrate summer - Buy 5 times between June and August
      • #2 Place 10 Orders above 50€ - Complete 10 transactions, for more than 50€ each
      • #3 Ambitious player - Log in to the game 3 times per week for 8 consecutive weeks
      • #4 SKU 'ABC' configuration - Spend total of 100$ on products with SKU 'ABC132' in September
      • #5 Workout track -Track a workout of at least 30 minutes for 5 days in a row
      • #6 4 referees made the transactions for 2 consecutive weeks
      • #7 2 referees made a transaction configuration
  • FAQ
    • Configuration Migration
    • Custom Attributes
    • Achievements
    • GDPR
    • Opt-Out
    • Referral Programs
    • Returns and Cancellations
Powered by GitBook
On this page

Was this helpful?

  1. Main Features
  2. Campaigns
  3. Creating Campaigns

Percent value distribution

Learn more about campaign based on the percent value distribution.

Percent value distribution

The percentage distribution is an Effect function that allows you to create ranges on the units that can be granted to members.

percent_value_distribution(event.body.progressChanges[0], [array thresholds], [array thresholdPercentValues], event.body.progressStatuses[0].currentPeriodValue - event.body.progressChanges[0])

  • percent_value_distribution - Function

  • event.body.progressChanges[0] - Value of the current order

  • [array thresholds] - Thresholds on the basis of which values will be calculated

  • [array thresholdPercentValues] - The values that will be used for the calculation. In the order corresponding to thresholds

  • event.body.progressStatuses[0].currentPeriodValue - event.body.progressChanges[0] - Current progress value without the current order

To understand this function, we can use the following example: If you want to give a member a reward that is calculated based on a percentage of the value of their transaction, but the amount of the percentage/ratio depends on the amount of the transaction total:

in the range of: 0 - 5000 → 1% in the range of: 5000 - 7500 → 1.2% in the range of: 7500 - 10000 → 1.5% in the range of: 10000 - Inf → 0%

You should use the following expression:

percent_value_distribution(event.body.progressChanges[0], [5000, 7500, 10000], [0.01, 0.012, 0.015, 0], event.body.progressStatuses[0].currentPeriodValue - event.body.progressChanges[0])

1. Create an Achievement - this is needed to calculate the total value of orders in a member's account

  • Over: 1 month - progress will be calculated in the span of one month

  • Goal: 10000000 - a distant goal used to store the value of the calculation

  • Formula: transaction.grossValue - We want to keep track of the Gross Value of the transactions

  • Occurrence: consecutive month - Prograss will be calculated monthly

  • Achievement counting: Sum of the event attributes - we will calculate attributes of the transaction

  • Direct / transaction - Achievement will be based on the transaction

2. Create a Campaign

  • Direct campaign

  • Internal event: Achievement progressed

  • Conditions: expression: event.body.achievementId == '<ACHIEVEMENT_ID>'

  • Fffect Add Units: percent_value_distribution(event.body.progressChanges[0], [5000, 7500, 10000], [0.01, 0.012, 0.015, 0], event.body.progressStatuses[0].currentPeriodValue - event.body.progressChanges[0])

3) After making a transaction, the achievement will track members’ progress and issue units based on the following formula: a monthly spend of up to $10K members get: $5K x 1% Cashback + next $2.5K x 1.2% + next $2.5K x 1.5%

Last updated 8 months ago

Was this helpful?