0
I would like to implement a page views counter on my site, present a numerical reference on the site, and use this data to perform a ranking of most accessed articles/post and automatically insert a widget, in the side bar of the site.
Node.js solves the problem, it makes this bridge between front and back using javascript, where I am more familiar, I can access the database, be it Mongobd and/or Mysql and learn a language that will dominate in the near future. Now is to devote to learning, let’s move on!
Why do you need this information? Just for analysis? If so, use Google Analytics (http://analytics.google.com). Then simply implement the tracking code on your website and you’ll get your information, including verifying visitors in real time.
– Ronny Amarante
For analysis you can use the Google Analytics, Now to create a Rankin own system of most accessed content, you need to calculate all the visits register in a database and then display this information. Can be done basically with any language.
– Ricardo
They’re not just a tag, no Ricardo, I want more than just to analyze.
– Thiago Jem
You can create a table in your database and each time the page is requested use a for() to add +1 to the database record! if you want to make a single counter use cookies to save the user and not re-register in the database if he has visited the page! Now this varies whether you do it in procedural or object-oriented! That was the first logic that came to mind, but has many ways to do this!
– Rech
If what you need cannot be supplied by the use of Analytics, then it would be best to use a database for this and insert a php (or server-side language you prefer) to add +1 in the number of visits from that page in the database... Then to pull this in a widget would just take the database data... If something is missing comments here that I complete the answer
– RodrigoBorth