: I would probably write the code myself to track them. Although perhaps it would be easier trying to hook it into analytics. I'm not sure how to do that. To do the re-direct you would want
I would probably write the code myself to track them. Although perhaps it would be easier trying to hook it into analytics. I'm not sure how to do that.
To do the re-direct you would want to use .htaccess (providing you're using Apache server)
The .htacess file might look something like this:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^([A-Z0-9]{5})$ track.php?id= [L]
The RewriteRule there will match someone going to example.com/HJK7D Basically example.com/ and any combination of 5 capital letters and or numbers. This will get re-written and the server will actually pull up track.php?id=HJK7D (in this case)
So drop that .htaccess into the main root directory of your website. Then create a file called track.php which might look something like this:
<?php
if(isset($_GET['id'] && strlen($_GET['id'])==5){
setcookie("id", $_GET['id'], time()+1209600); // expires in 2 weeks
}
header("HTTP/1.1 301 Moved Permanently");
header("Location: www.example.com/ );
?>
Then use the cookie $_COOKIE['id'] to track your visitor through your site.
More posts by @Berryessa370
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.