try creating tables in your database to save the necessary information.
On top of my head, I might think to save my IP address
get information about GEO, and you can use this IP address to get and store the country in which they are located.
You can save the web page that they were on before coming to your site.
How many times they came to your site and the pages they visited, and how many times on each page.
IP address can be obtained using
$_SERVER['REMOTE_ADDR']
and
$_SERVER['HTTP_X_FORWARDED_FOR']
geo-information for getting your country can be obtained on many websites ... Usually you need to pay for it if you want to update information ... some people do not have free older information, which is still very useful.
Here is a good provider of GEO information you pay for, but it's very cheap.
http://dev.maxmind.com/geoip/geoip2/web-services/
to make the number of visits, just grab their IP address, when they arrive, search the database for that IP address, and if it exists, increase the number of visits by 1. If you do not create a new visitor. Do the same increment on every single page.
use this to get the url they were at before coming to your site.
$_SERVER['HTTP_REFERER']
So a table like this:
userId | userIP | userCountry | visits | webpage1Visits | webpage2Visits | webpage3Visits
Assuming you don't have thousands of pages, this might work on a dozen pages.
There is a ton of other things that you can store as the average time on the site, etc., but this is the main material.
give it a try and when you run into problems along the way ask more questions and people will help :)