Answer the question
In order to leave comments, you need to log in
Does anyone know how to record in cookies (or something else) how many times a user has visited the site?
Does anyone know how to record in cookies (or no matter how) how many times a user has visited the site?
Answer the question
In order to leave comments, you need to log in
const s = window.localStorage; // хранилище
const key = 'mySiteVisitCounter'; // название счётчика
const n = 1 + (s.getItem(key) >> 0); // считываем записанное, если есть
s.setItem(key, n); // сохранить обновлённое значение
console.log("Page access count:", n); // вывести что-то куда-то
You can do this through a node, write a script in the html file that will make a request to the north (any), and on the server just catch ip-addresses. Number of requests = the number of all visits to the site, and if it is necessary for specific users, then you can save ip-addresses in the database
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question