In doing some Internet Searching I came across an interesting feature on the IBM DeveloperWorks Web Site. For the purposes of this demonstration, I’ve done some more testing to make it easier to demonstrate.
DeveloperWorks in response to a Google Search, prompts the user within the page to continue searching the IBM site with the same search criteria entered from the Google Search. In theory this would not be complicated, this referrer information is available and used in most Web Stats programs that troll log files and then provide a Section showing Search Engine Terms that directed traffic to your site.
What I surprised about, is that IBM (A large company, and key open-source proponent), restricts this functionality to Google Only. Check this out.
For each Search engine in our test, we are going to go to the respective search page, and enter the term IBM Federated Database Technology.
As a result, most search engines should provide a reference to the article at http://www-128.ibm.com/developerworks/db2/library/techarticle/0203haas/0203haas.html in the top results. We are then going to view this webpage from selecting the search results link.
The Search Engines I used were: Google · Altavista · Yahoo · Ask Jeeves · Excite
The code in effect is very simple, just some javascript.
if (document.referrer&&document.referrer!="") { // document.write(document.referrer); var q = document.referrer; var engine = q; var isG = engine.search(/google.com/i); var searchTerms; //var searchTermsForDisplay; if (isG != -1) { var i = q.search(/q=/); var q2 = q.substring(i+2); var j = q2.search(/&/); j = (j == -1)?q2.length:j; searchTerms = q.substring(i+2,i+2+j); if (searchTerms.length != 0) { searchQuery(searchTerms); document. write("<div id="contents"></div>"); } } }