Documentation Index

Fetch the complete documentation index at: https://docs.xtremepush.com/llms.txt

Use this file to discover all available pages before exploring further.

Dynamic Rewards

Prev Next

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:

  1. Select the dynamic icon next to the reward

  2. Select the user attribute that will be used to calculate the dynamic reward amount.

  3. 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.js to 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}

If you require assistance creating complex custom logic, reach out to the Xtremepush Onboarding team.