I assume you're asking how to send an asynchronous request for tracker.php, AKA AJAX. W3 schools has a guide on that here: http://www.w3schools.com/ajax/ajax_xmlhttprequest_send.asp
The IP address and Date/Time can be easily gotten without passing any information down from the website. If you want to pass information such as the page they are on and the resolution of their viewing area, then one very easy way to do it is to pass URL variables.
xmlhttp=new XMLHttpRequest();
xmlhttp.open("GET","tracker.php?WindowWidth=" + window.innerWidth +"&WindowHeight=" + window.innerHeight + "&Page=" + encodeURIComponent(document.URL) ,true);
xmlhttp.send();
These variables will be loaded into the tracker.php as the array $_GET
$Width = $_GET["WindowWidth"];
$Height = $_GET["WindowHeight"];
$Page = $_GET["WindowPage"];
There are more elegant solutions, such as $_POST
which allows far more information to be passed down in a single request, or 1x1 tracking images. The Page they are on can also be acquired by using $_SERVER["HTTP_REFERER"]
on tracker.php.