2
I have a script that records all the views of the pages of my site that I downloaded, and it’s working very well. Only now some problems have arisen in what it comes to GOOGLE visitation, and has "a lot", more "a lot" visitation of the Google Robots and is not cool to have a website visitation base.
$db->query( "INSERT INTO visitas (ip_address,page_location,date_visitation,visitor_browser,visitor_plataform,visitor_city,visitor_region,visitor_country) VALUES ('$ip','$page_location','$date_visitation','$visitor_browser','$visitor_plataform','$visitor_city','$visitor_region','$visitor_country')" )->fetchAll();
As far as I know, the google robot doesn’t spend more than 5 seconds on a page of the site.
I would like to make this INSERT run after 10 or 15 seconds. Would it be possible? or would there be another solution to this situation?
Grateful for the support.
EDIT 1
The need arose to only the Function setCounterVisitor() run after 15 seconds, due to my script being required on another page. It is important that to work Function it comes is on the same page and not in Visitor.php.
<?php
require_once 'app/visitor.php';
setCounterVisitor();
?>
It is possible to execute the setCounterVisitor(); after 15 seconds on loaded page?
put the code in a php file and call it with ajax, in this ajax do a
setTimeou
– Costamilam
Could you give me an example? the code is already in a separate PHP file. It is calling in a requere_once.
– Fydellys