The following PHP is used on my WordPress web site to obtain information about those visiting my web site:
Information includes:
IP address
City
Country
State
Page visited
Referer
Create a table in your database to store the data
Get a free account from ipinfo.io and they will give you a KEY
Edit the code below placing your database name and table names into it
Also place in the secret key for ipinfo.io
place the code into a [Short Code] editor
I use: “Insert PHP Code Snippet” By xyzscripts.com
Than, insert the short code into all of your web page you want to gather statistics on the visitors.
For myself, I place the short code at the bottom of each page I want monitored for purpose of gathering statistics.
The PHP code:
| Grid Status: | ![]() |
| Members: | 57 |
| Online last 30 days | 9 |
| Online past 24 hours | 6 |
| Unique hypergrid visitors | 184 |
Web design and created by: Jeffrey Dougall ©2024