Internal event - Achievement progressed

Learn more about the campaign based on the Achievement progressed internal event.

Internal event - Achievement progressed

It is possible to create a campaign based on the progression of an achievement, rather than its execution. By using this functionality, we can reward our users for making progress within an activity or create an advanced cashback threshold mechanism added to the Campaigns Effect.

It is possible to use achievement-related properties in the following Campaigns:

  • periodGoal - goal yet to be achieved

  • currentPeriodValue - current progress value

  • consecutivePeriods - applicable only for consecutive Achievements: periods yet to be achieved

  • completedConsecutivePeriods - current achieved periods

  • progressChanges - the difference between the current periodGoal and the previous periodGoal

If you want an overview of the structure of achievement progress, you can look at the webhook response MemberAchievementProgressWasChanged.

e.g. 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%

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 - Progress 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: Achievement is one of 'Achievement name'

  • Effect 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])

Last updated