Dynamic Rewards
Create dynamic rewards that differ based on user attribute values
Dynamic rewards allow you the reward different reward amount based on user's attribute value. For example, a user is given a dynamic token reward for completing a weekly deposit quest. The dynamic reward could be 5% of the total_deposit attribute.
To configure a dynamic reward:
-
Select the dynamic icon next to the reward
-
Select the user attribute that will be used to calculate the dynamic reward amount.
-
Specify the Reward Condition:
- Percentage: This makes the reward a percentage of the user attribute. Using the deposit example, if you enter 5, the reward is 5% of the _total_deposit _attribute.
- Percentage by Level: This option lets you give a different percentage reward for each level. This ensures that users on different levels receive different reward amounts. For example, Level 1 Segment gets 5% of the total_deposit whereas Level 2 gets 10% as shown below:
-
Raw Expression: Use
math.jsto create custom logic for reward distribution. Some examples include:- If you want to award one perk for every 1,000 units deposited, enter the following expression as shown in the image below:
floor(event.body.origin.body.amount / 1000)
-
You can assign a different number of quests based on the value of a user attribute. For example, if a user has a tier attribute set to gold, they could be assigned more quests than a user set to bronze
- Expression:
config[userAttributes["attribute.tier"]]Config:{"bronze": 1, "silver": 2, "gold": 3}
- Expression:
- If you want to award one perk for every 1,000 units deposited, enter the following expression as shown in the image below:
If you require assistance creating complex custom logic, reach out to the Xtremepush Onboarding team.
Updated about 5 hours ago