Clicks-counter button that records the number of clicks, like "Instagram Likes"

Hi, I want to create a button for unique visitors that have problems viewing the whole site to click on the button, and the button will record the number of clicks so that I can estimate how many unique visitors have the issue. I tried to connect it to a dataset, but don’t know how to make the button to record the number of clicks into the dataset.

Please help, thank you!

1 Like

Hi there …

You can’t do this with a dataset, you need to use wix-data APIs for that.

Hi, thanks for the advice. I’m not sure how to incorporate that into code. Could you provide more details?

@clee74 you need to query the item, get the number of clicks and increase it by 1.

Example:

wixData.query('col').find().then((x) => {
    const item = x.items[0];
    if (item) {
        item.clicks += 1; // Increasing the number of clicks by 1;
        
        // Save the item again.
        wixData.update('col', item);
    }
})

how do you make a views counter for a video

@ahmadnasriya how do you make a views counter for a video

hi

Instagram has taken the comments from its users into consideration and has decided to become a platform where people can freely express themselves without feeling compelled to produce high interaction https://www.wix.com/velo here