Guide to Technology

eg: UK or Brides UK or Classical Art or Buy Music or Spirituality
 
eg: UK or Brides UK or Classical Art or Buy Music or Spirituality
 
Business & Money
Technology
Women
Health
Education
Family
Travel
Cars
Entertainment
Featured Sites
SD Editorials
Online Guide and article directory site.
Foodeditorials.com
Over 15,000 recipes & editorials on food.
Lyricadvisor.com
Get 100,000 Lyric & Albums.
  • Business & Money
    • A Guide to Business
    • Guide to Finance
    • Ideas for Marketing
    • Legal Guide
    • Guide to Insurance
    • Lettre De Motivation
    • Guide to the Stock Market
    • Human Resource Career
    • Sales Marketing
    • Forex & Trading
    • Advertising & Marketing
    • Startup Guide
  • Technology
    • Guide to Technology
    • Cell Phones
    • Computer Software
    • IT Hardwares
    • Internet
    • Online Security
    • Cameras
    • Search Engine Optimization
    • Science & Technology
  • Women
    • Guide to Women
    • Relationship Advice
    • Marriage
    • Jewelry
    • Pregnancy
    • Fashion Style
    • Divorce Guide
    • Wedding Guide
    • Dating Guide
    • Natural Beauty
  • Health
    • Guide to Health
    • Guide to Medical
    • Plastic Surgery
    • Weight Loss
    • Sports
    • Body Wellness
    • Cancer Treatment
    • Common Illness
    • Health & Lifestyle
  • Education
    • Military Service
    • Politics and Policy
    • Arts & Humanities
    • Education and Teaching
    • Learn Languages
    • Colleges & Universities
  • Family
    • Quality Home Improvement
    • Hobbies and Interests
    • Family Guide to
    • Pet Guide
    • Loans Guide
    • Credit Cards
    • Gardening Guide
    • Home Security
    • Real Estate
    • Home Decor
    • Gift & Present
  • Travel
    • The Travel Guide
    • Adventure Travel
    • Cruise Ships
    • Beach Holiday
    • Travel Accommodation
    • Holiday Destinations
  • Cars
    • Information on Cars
    • Traffic Violations
    • Auto Insurance
    • Trailers
    • Sport Cars
    • The Bikes
  • Entertainment
    • Entertainment Guide
    • World Music
    • Photo & Video
    • Television & Games

Detect When Googlebot Has Come To Visit

    View: 
Whenever I start up a new website, I am always keen on knowing when Googlebot if going to come and visit for the first time and after that first visit when it returns for the second and third time. Now Google is only going to find and index your website if there is ATLEAST one other website that is linking to you.



But im not going to talk about the whole SEO thing, instead i'm am going to quickly go over how I made a PHP script which tells me when Googlebot comes to my website.

Googlebot always identifies it's self by the useragent header, and PHP has a $_SERVER variable which contains that, so really it's just going to be a matter of checking the server variable with what's in the useragent header. We can get information on Googlebot and what the useragent it uses is, by doing a quick search in Google for "Googlebot useragent".

Now we have the useragent Google uses (which is simply Googlebot) we just need to make a script which, when triggered checks the useragent and if it's a match for Google sends us a nice email. First we create a new text doc and rename it to googlecheck.php, open this with notepad or your favorite text editor.

The first line we want to type in is
Next we'll declare the email address we want the notification sent to, the subject of the email, and the body.

$address = "email@domain.com";

$subject = "Google has visited";

$body="Google has crawled!

Date:".date(?d-m-Y?)." to my site at ".date("g:i A");

Now that is good, but if we have more then one website it will be hard to track which site it came from, so lets modify our subject.

$subject = "Google has visited ".$_SERVER[?HTTP_HOST?];

Thats better, now the site domain will be added to our subject.

Now we need to get the useragent and check that it's Google.

$useragent = $_SERVER[?HTTP_USER_AGENT?];

$google = "Googlebot";

$isgoogle = strpos($useragent, $google);

If ($isgoogle === false) {

//not a Google hit

} else {

//This is Google

So lets go through the above lines, we set the variable $useragent to the useragent in the headers, and then set the $google variable

to the Google useragent ? then we check to see if Google is in the headers by using to strops function and lastly put it into a IF statement, So now we need to send the email.

mail($address,$subject,$body);

and close the IF statement

}

then ?> to close the PHP file.

Now this works fine, however there is two things that we should really do. First it would be nice if we could tell which page that Googlebot visted, and second we should put some headers on our email.

Lets modify the body so we know which page Google crawled.

$body="Google has visited!

Date:".date(?d-m-Y?)." to our site at ".date("g:i A")."

Crawled the page ".$_SERVER[?PHP_SELF?];

and lets put some headers onto our email

$header = "From: ".$address."" . "

" .

"Reply-To: ".$address."" . "

" .

"X-Mailer: PHP/" . phpversion();

mail($address,$subject,$body,$header);

That looks perfect!

We what the script to trigger when the page gets loaded, so all we need to do is open the pages we want this file to be trigged from (like our index or page header) and at the top of the page do


include(?googlecheck.php?);

?>

Now all we have to do is wait for Googlebot to come along :-)
More Articles from
Web Site Development Pg201
A Purpose Driven Life
How To Put Line On A Spinning Reel
Interior Design Website Templates
Million Dollar Basketball Shot
Nail Biting In Children
Psd To Html Conversion
Psd To Xhtml Conversion
Put Your Boots On
Qualities Of A Good Citizen
Qualities Of Effective Leader
Quantum Physics Law Of Attraction
Questions To Ask A Boy
Quick And Dirty Tips
Social Network Analysis Software
Squirrel Nut Zippers Put A Lid On It
The Law Of Attraction Dvd
Web Application Development Services
World Wide Web Creator
Questioning Online Credibility
Put Your Ideas Into Action Today!
» More on
Web Site Development
  • Related Articles
  • Author
  • Most Popular
Nicholas Fauchelle has sinced written about articles on various topics from Software, web development. What to see just the finished script, simply go here http://www.nicksblogspot.com/detect-when-googlebot-has-come-to-visit. Nicholas Fauchelle's top article generates over 880 views. Bookmark Nicholas Fauchelle to your Favourites.
Black People Meet Online
Using people search can really help save your life so use it now before its too late.For more information visit People Lookup
 
A Guide to Business | Guide to Technology | Guide to Women | Guide to Health | Family Guide to | Travel & Vacations | Information on Cars

EditorialToday Guide to Technology has 3 sub sections. Such as Technology, Increase Adsense Revenue and Information & Technology. With over 20,000 authors and writers, we are a well known online resource and editorial services site in United Kingdom, Canada & America . Here, we cover all the major topics from self help guide to A Guide to Business, Guide to Finance, Ideas for Marketing, Legal Guide, Lettre De Motivation, Guide to Insurance, Guide to Health, Guide to Medical, Military Service, Guide to Women, Pet Guide, Politics and Policy , Guide to Technology, The Travel Guide, Information on Cars, Entertainment Guide, Family Guide to, Hobbies and Interests, Quality Home Improvement, Arts & Humanities and many more.
About Editorial Today | Contact Us | Terms of Use | Submit an Article | Our Authors