Sunday, September 1, 2013
Track Visitor Stats - Revisited
Track Your Website Visitors... Easy!
The script creates a polished user interface for displaying your IP visitor stats, and works with a number of IP location services available. If you don't subscribe to any IP location service, the script uses the ip2location lite databases freely available from http://lite.ip2location.com. For more information on your visitors, you can subscribe to the Maxmind GeoIP OMNI Web Service for as little as $20 for 10,000 lookups. The 10,000 lookups translates to a lot of visitors, as the script only looks up the visitor info on the first visitor and stores it for use on subsequent visits. Alternatively, you can also sign up for the IPInfoDB service freely available at http://ipinfodb.com. The script uses this service as a backup if visitor info is not located in the other databases.
So, your website looks fantastic! You've invested a huge amount of time and a little money getting it up and running! You've had a few visitors, you think. Not many people buying anything, or leaving comments. Just how many people are visiting your site? Where are they coming from? Are they new visitors, or returning visitors? What pages are they going to? What pages are they coming from? What pages are the most popular? What pages are your visitors not even bothering to look at?
That's the kind of questions you ask yourself when you have a website intended to drive traffic and sales.
Since websites first appeared, people have analyzed what was happening with their sites. It started with simple counters on personal pages to track the number of visitors. But now, website owners are looking for more sophisticated statistics. Today, stats are the essential tool to measure and manage a business or a website successfully.
So, you want to know more about your visitors and where they are coming from, where they are going on your site, and how many times they have visited. This PHP script will provide all that information and more.
Installing the script is very easy. The script is essentially self-contained. Other than placing a simple link to the tracking file on the page you want to track, you don't have to do anything else. You don't have to mess with databases at all. The script makes use of the sqlite3 database available in most PHP installations.
That's it! All your visitors will be tracked and the stats will be stored in a simple sqlite3 database. No messing with MYSQL databases at all.
If you have a header file, for instance, that is included in each page, copy the link to trackip.php in that file and it will capture all the pages.
To view the visitor stats is just as easy. Just create a blank php file. You can call it "visitors.php" and include the following line:
On the visitors page, click on the IP address to learn more about the particular visitor. I've been using this script for a few months now and it has given me a wealth of information and has lead to improved creative direction and sales.
Using Cron For Smoother, Faster Operation
Normally, the visitor script updates the location information when it is opened. If you haven't viewed visitor information for awhile, it may take some time for the visitor info to refresh. To improve performance, you can use cron to update the visitor stats while offline. This way, the latests visitor information is always readily, and quickly, available. If you haven't used a cron service before, you may have to speak to your website administrator about setting up the script. It's easy, but can be daunting if you haven't done it before.
Use the following cron setting to update every five minutes using PHP 5.4
Replace USERNAME and the path to update.php as necessary. You will probably have to change the path to php as well, usually '/usr/bin/php', but it may be different on your server. Check with your website administrator if you do not know how to set up a cron.
The line below will update the visitor information every 5 minutes.
So what are you going to find out about your visitors using this script. How about:
- What countries your Web visitors are surfing from
- What city / state or province are your visitors from
- What time did they visit
- How many times have this visit been to your site
- How many visitors have you had to your site
- What pages your visitors start their visit on
- What pages your visitors go to next
- What sites are sending visitors to you
- What search words are being used to find your site
- What type of ISP is being used: ie: residential, business, college, etc
- What is the name of the organization, if any
- What browsers your visitors use
- Are your visitors using a mobile phone
- What kind of computers (OS) are your visitors using to surf the Web
- What screen resolutions your visitors set their monitors to
- What is your visitors IP address
- What time zone are your using in
- What language are your visitors using
Sometimes you may need or want to control who you are tracking, or ban certain IP addresses from your site altogether. You can do this and more from the main visitor screen. For example:
- You can delete selected IP addresses
- You can stop tracking of selected IP addresses
- You can ban selected IP addresses
- You can ban selected countries from visiting your site
- You can mark selected IP addresses as search bots
- Hide bots
- Filter on specific country
- View the raw database
- Configure Imprint
Pay close attention to your stats and easily chart what your users are doing over time. You can see what your site visitors are reading and what keeps them coming back for more. You can see what your visitors find the most important. Or not important at all. You can then use this information to improve sales, which is really what this is all about. Isn't it?
Learning about your visitors and using this information as a guide is the best way to make sound marketing decisions.| Share More...