Display Reward Campaign Progress
Last updated
Last updated
Customer's Progress API helps you display the customer's progress in different Gameball programs within your app or web page. It returns the customer's progress in reward campaigns, VIP tiers, wallet points balance, and referrals, in addition to other information related to the customer.
Let's begin with a simple use case where you would like to show the customer their progress in achieving the available reward campaigns
All the needed information is available in the reward campaign progress array within the customer's progress API response, as follows:
The reward campaign progress holds the progress of the customer against every eligible reward campaign. Let's examine each reward campaign attribute returned by the reward campaign progress array and see how they can help us in building the UI.
First thing we may use is the id, name, description and icon. These attributes can be used to draw the eligible reward campaigns list for the customer without progress information.
Now let's say you want to highlight the achieved reward campaigns and dim the non achieved reward campaign on your UI. You can easily do this by checking the achievedCount
attribute. Where a 0 represents not yet achieved and 1 or more denotes that a reward campaign was achieved at least once.
In our example the Welcome reward campaign achieved count is equal to 1 and First Order reward campaign achieved count is equal to 0, hence we will be adding a dimming style for the First Order reward campaign icon.
For reward campaigns where a customer has done a progress but not yet completed, you can make use of completionPercentage
attribute where it represents the current progress. Let's say we have a reward campaign “Tenth Order” that the user will achieve when making 10 orders. If the user completed 6 orders, the response will look like this: