Sorry for such a vague question. Am I on the right track going about this? Any tips, code, or references will be much appreciated.
For a more accurate way you have to use a server-side language and maybe add a storage engine like a database to make it work.
I suggest you start here Php for beginners the link might be old but it covers all the basics you need to know to create your counter.
PHP or another server side script language. That can then update the count on the file with no issues.
Most sites with a counter I see with a lot of traffic use a timed counter and use ajax to get the real number upon load.
©2020 All rights reserved.