I use this simple script:
<script type="text/javascript">
var _mytrack = _mytrack || [];
_mytrack.push(['_setType', 'SOMETYPE']);
_mytrack.push(['_setEmail', '[email protected]']);
(function() {
var mytrack = document.createElement('script');
_mytrack.type = 'text/javascript';
_mytrack.async = true;
mytrack.src = ('https:' == document.location.protocol ? 'https://www' : 'http://www') + '.mytrack.net/tracker.tell.php?i='+_mytrack;
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(mytrack, s);
})();
</script>
My PHP script (tracker.tell.php) looks like this:
header("content-type: application/javascript");
echo "alert('".$_SERVER['REMOTE_ADDR']."');";
Now the question is related to the $_SERVER['REMOTE_ADDR'] because this gives (in an JS alert) the IP of the SERVER and not of the CLIENT.
X-Forwarded-Foris most common.