I have a web site on wordpress. I want to add a counter that counts unique visitors. Is this possible just using javascript? Is any server side script required? If server side script is required, how can I store the result count?
Asked
Active
Viewed 3,029 times
0
-
1You will need server side scripting. If you wish to code all the way by yourself refer http://stackoverflow.com/questions/18799808/how-do-i-count-unique-visitors-to-my-site . If you choose to use existing Wordpress plugins, http://wordpress.org/plugins/statpress-visitors/ plugin is useful. – Gaurav Bhor Nov 17 '13 at 11:09
1 Answers
1
Unfortunately Javascript won't do what you are asking. What you can do is use a .txt file or mysql table to store the count and connect using jQuery Ajax.
Server side scripting is required, you need information from the user to identify whether they are unique or not, this could be done by ip address.
If you want to count users for a site performance reasons and display in backend, Google analytics plugins are useful.
For a frontend display have a look at these: http://wordpress.org/plugins/tags/hit-counter
Or if you want to DIY: study this link, replace mysql with wpdb connection (wordpress method of connecting) http://coursesweb.net/php-mysql/register-show-online-users-visitors_t

David
- 5,897
- 3
- 24
- 43