0

In my website each post has a download button for a certain asset. I want to be able to sort my posts by how many times an asset has been downloaded (or, in other words, how many times the download button has been clicked).

I figure I should keep a variable that goes up every time someone clicks the download button, and store that number as a metadata value to use in the sorting function later on. Is this the right way to approach this? Will it overload my hosting if a lot of users click the download button?

So, in short, what is the best way to keep track of how many times the download button was clicked on every post?

Thank you in advance!

1

I think you have the correct approach when you want to use a meta data value for it. I would do it the same way. I don't quite know how downloads are arranged, but I think it shouldn't be to hard to add an action which adds 1 to the count, after download.

A server overload is not really an issue unless you get 100's of click in a short time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.