From: maxious Date: Thu, 05 May 2011 03:12:51 +0000 Subject: Add page speed analytics, stop googlebot-image from ruining site hits X-Git-Url: https://maxious.lambdacomplex.org/git/?p=busui.git&a=commitdiff&h=c097ff8584a4aba3c98adfdfce6cf935277257da --- Add page speed analytics, stop googlebot-image from ruining site hits --- --- a/include/common-template.inc.php +++ b/include/common-template.inc.php @@ -5,6 +5,7 @@ function googleAnalyticsGetImageUrl() { global $GA_ACCOUNT, $GA_PIXEL; + //if (stristr($_SERVER['HTTP_USER_AGENT'], 'Googlebot') return ""; $url = ""; $url.= $GA_PIXEL . "?"; $url.= "utmac=" . $GA_ACCOUNT; @@ -187,6 +188,7 @@ var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-22173039-1']); _gaq.push(['_trackPageview']); + _gaq.push(['_trackPageLoadTime']); "; echo ' --- a/include/common.inc.php +++ b/include/common.inc.php @@ -30,10 +30,11 @@ include_once ("common-geo.inc.php"); include_once ("common-net.inc.php"); include_once ("common-transit.inc.php"); +include_once ("common-db.inc.php"); + +include_once ("common-request.inc.php"); include_once ("common-session.inc.php"); -include_once ("common-db.inc.php"); include_once ("common-template.inc.php"); -include_once ("common-request.inc.php"); function isDebugServer() { --- a/robots.txt +++ b/robots.txt @@ -1,4 +1,6 @@ User-agent: * Allow: / +User-agent: * +Disallow: /lib/ga.php sitemap: http://bus.lambdacomplex.org/sitemap.xml.php --- a/sitemap.xml.php +++ b/sitemap.xml.php @@ -8,19 +8,15 @@ foreach (scandir("./") as $file) { if (strpos($file,".php") !== false && $file != "index.php" && $file != "sitemap.xml.php") echo " ".curPageURL()."$file0.3\n"; } -$url = $APIurl . "/json/stops"; -$stops = json_decode(getPage($url)); -foreach ($stops as $stop) { - echo " ".curPageURL()."stop.php?stopid=".htmlspecialchars ($stop[0]).""; +foreach (getStops() as $stop) { + echo " ".curPageURL()."stop.php?stopid=".htmlspecialchars ($stop["stop_id"]).""; echo "" . $last_updated . ""; echo "monthly"; echo "0.9"; echo "\n"; } -$url = $APIurl . "/json/routes"; -$routes = json_decode(getPage($url)); -foreach ($routes as $route) { - echo " ".curPageURL()."trip.php?routeid=".htmlspecialchars ($route[0]).""; +foreach (getRoutes() as $route) { + echo " ".curPageURL()."trip.php?routeid=".htmlspecialchars ($route["route_id"]).""; echo "" . $last_updated . ""; echo "monthly"; echo "0.9";