Javascript + PHP script to keep track of unique visitors on your site: Logs resolution, viewport, browser, operating system in database.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md
jQuery v1.10.2.js
jquery.cookie.js
saveData.php
trackUser.js

README.md

trackUser

Created by: Brandon Parrott (Peezy Bro) Date: 10/22/13

Discription: trackUser is a project to track unique users that visit your website. trackUser, also logs the users screen resolution, screen viewport, Brower name + verison, Operating System, Date, and IP Address.

How To: First, you need to set up your database and create a table to store the information.

    CREATE TABLE `trackuser` (
    `id` INT(15) NOT NULL AUTO_INCREMENT,
    `resolution` VARCHAR(20) DEFAULT NULL,
    `viewport` VARCHAR(20) DEFAULT NULL,
    `browser` VARCHAR(50) DEFAULT NULL,
    `os` VARCHAR(25) DEFAULT NULL,
    `dateVisted` VARCHAR(20) DEFAULT NULL,
    `ipAddress` VARCHAR(20) DEFAULT NULL,
    PRIMARY KEY (`id`)
    ) ENGINE=MYISAM DEFAULT CHARSET=latin1;

Place the trackUser.js and jquery.cookie.js files in your perfered folder and place the following in the header of your index page.

    <script type="text/javascript" src="jquery.cookie.js"></script>
    <script type="text/javascript" src="track.js"></script>

Make sure you include the latest jquery file.

NOTE: This is a learning project for me, if you have any tips on making it better, simpler, neater, please feel free to make changes.