Search tool usage monitoring

1

On my client's site, there is a kind of search tool. This search requires that the user choose which of the sections (pages) he wants to search. With the desired word and section chosen, it redirects to the page and brings the desired search results.

For example, if I want to search for something in the Download Center, the page usually is: mysite.co.uk/services/centraldownloads/

But if I use the search tool: myite.com.br/busca/6 /

What I wanted to know is how I can and can monitor how many people are going to these pages through the search (pages beginning with www.mypage.com).

The other thing I imagine if you could do a monitoring is through the SEARCH button of this search tool, it has the following HTML code:

<input type="submit" class="BtnBuscar replace-bt" value="">

Does anyone have any ideas?

    
asked by anonymous 17.05.2017 / 15:31

2 answers

2

Monitored pages

$result = $_SERVER['HTTP_REFERER'];

$pos = strpos($result, "meusite.com.br/busca");
    if ($pos !== false) {
        // script .....  
    }
  

This referer log is used to allow web sites and web servers to identify where people are visiting you, ie by checking the referer, the new web page can see where the request originated from. (In short: knowing where the user came from, what page he was who sent him to the new page).

    
17.05.2017 / 16:30
1

The best way is to use $ _SERVER ['HTTP_REFERER']; and store it in the Database, so you can use PDO normally. ex:

$sql = $pdo->prepare("INSERT INTO tabela SET val = valor");
$sql->execute();
    
17.05.2017 / 16:37