Track visitors to a specifik url?

danniee

Registered
Oct 18, 2020
3
2
3
UK
cPanel Access Level
Website Owner
Hi,

The Visitors feature is very helpful and displays who visits specific links with info about IP, user agent and time etc. Is it possible to set it up so that you are notified whenever someone visits a specific link? For security reasons I want to keep track of who visits a certain url.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,297
1,251
313
Houston
Hi @danniee

While stuff like awstats and webalizer will show you when someone will access a certain link but there's nothing native to cPanel as far as I am aware that will notify you. There are solutions for this like URL filtering associated with many firewall appliances. There are also opensource solutions like Canarytokens.org - Quick, Free, Detection for the Masses though I cannot provide any recommendation on this specifically as I am not familiar enough with the product to do so.

I am curious though, what is the use case for this (i.e., what is the reason for wanting to do this)?
 

danniee

Registered
Oct 18, 2020
3
2
3
UK
cPanel Access Level
Website Owner
Hi and thank you for your kind help.

The reason is I want to track competitors who will be trying to find specific url:s that I am trying to hide (only for Google's eyes). I will take a look at the links you have provided and see if I can find a solution. Thank you :)
 
  • Like
Reactions: cPanelLauren

PlotHost

Well-Known Member
Apr 29, 2011
291
14
68
US
cPanel Access Level
Root Administrator
Twitter
Here is some PHP code. To test it create a new PHP file - test.php for example, add the code, save and access it in your web browser. You will get an email with some info - IP, browser details, time, URL..
Code:
<?php
$ip =  $_SERVER['REMOTE_ADDR'];
$url = $_SERVER['REQUEST_URI'];
$browser = $_SERVER['HTTP_USER_AGENT'];
$ref = $_SERVER['HTTP_REFERER'];
$time = date('Y-m-d H:i:s', $_SERVER['REQUEST_TIME']);

$message = $ip."\n".$url."\n".$browser."\n".$ref."\n".$time;

mail('[email protected]', 'new visitor', $message);
?>