Google Google search box within website-Adsense integrated

Sep 27, 2010

Google search box within website-Adsense integrated

Many web developer prefers to place a Google search box in website.
When the visitor search by Google search box ,the search result is fetched from Google search indexing of the website,not from the website.

Why Google search box is recommended in websites

  • Web developer can earn by Adsense integrated Google search box.
  • Some visitor feels comfort to search with Google search,as they are mostly familiar with it.

limitation of Google search box

As it is stated before Google search is dependent on Google indexing,fresh items that is not indexed yet will not be included in search.
Read here details.

Adsense integrated Google search Box code

  • You can put adsense ID in place of highlighted code.
  • I have apply a simplest CSS on Button .
  • The search result opens in a new page,if you don't want this remove target="_blank".
  • Some browser may tret the javascript as a n element and reserve space,so you should place the javascript bottom of the page ,don't worry it will work.
Demo:
[html]

<form action="http://www.google.com/cse" id="cse-search-box" target="_blank">
  <div>
    <input type="hidden" name="cx" value="partner-pub-Adsense ID here" />
    <input type="hidden" name="ie" value="ISO-8859-1" />
    <input type="text" name="q" size="26" />
    <input type="submit" class="search-style"name="sa" value="Search" />

  </div>
</form>
<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=en"></script>
[CSS]
<style type="text/css">
.search-style
{
margin:2px 2px 2px 3px;
background:#7F4E52;
color:#FFFFFF;
font-size:12px;
font-family: Georgia, 'Times New Roman', serif;
text-align:center;
}
.search-style:hover
{
background:#800517;
}
</style>




No comments:

Post a Comment