Question:
Hi! I would like to have a website that is gamified in the sense that for every new page a member goes to, they are awarded a point. I would think the best way to do that is with Wix’s built-in Loyalty program. However, I don’t see an option to make an automation that automatically awards a point when a member visits a page. I feel like there must be a way to do this? Even better would be for the member to need to check a check box on the page in order to receive the points.
Product:
Wix Editor
I don’t think Loyalty Points has a built in option to award points based on every new page visited. This would have to be custom coded using the earnPoints() function of the wix-loyalty.v2 API.
Hmm, could you elaborate? I took a look at the page but it doesn’t help me understand how to actually do it at all. 
So what you’re trying to build out may seem pretty easy and straightforward at first glance, but it actually is not. Here’s why:
- Like I mentioned already, the Wix Loyalty Program App does not have a native solution that will award points to users based on the page they visit. So this would entirely have to be custom coded.
- You will need to keep track of which pages were visited by which user, and code it such that the points are awarded only for first visit. You will also have to link it to the user’s account, or the device… depending on your logic. So that if a user has visited a page from his computer already and has received the points for that, you may not want to give them points if they visit the same page from another device. So you will require some kind of a way to track the points earned by each user.
- Also, you will have to code it in such a way that the checkbox is disabled or hidden if a user has already visited that page previously, and only shown if a user is visiting the page for the first time.
- For this, you will need to come up with a clever way to map the loyalty points that were added to the user’s account, maybe through the idempotencyKey or the description.
- Or you may take a different approach altogether and instead use the CMS to create your own loyalty points system…
The possibilities are endless, but it isn’t easy even though it seems so. This would require intermediate to advanced knowledge of code. I just pointed you to the reference documentation for you to take a look at the example code that can help you get started.
1 Like
Thank you so much Pratham for all your help. I understand now (or at least understand that it’s not something as simple as I would have hoped). 
So w hat would you suggest as the best solution for what I’m trying to do? Essentially, give points/rewards/badges as people progress through the site, to gamify the process and give people an incentive for visiting more and more pages?
Thank you,
Austin 
Hey Austin,
The only possible way to do this currently, as far as I know, is to have it custom coded using Velo.
Yep, I’d use Wix Members and CMS collection with custom code to track it all.
using Wix Members you can code to track the click action on each page. Store it in the CMS and then have a custom Members page that can show stats. Build on that by coding a badge system based on the amount of pages viewed.
To elaborate more would require a detailed breakdown of the exact flow required. The pages could be built and then coded to suit elements.