Friday, July 30, 2010

How to Replace Blog Search With Adsense For Search

Adding Adsense for search on your site will let you make some extra bucks with minimum efforts, right? For maximum queries from your site, make sure that the google custom search (Adsense for search) box is placed on the top right of your blog. If you have a blog template like studiopress that has beautiful inbuilt search box on the top, then don't go for adding extra adsense search box.

If your blogger template already have search bar, we can replace the normal search code with adsense search code to show ads whenever users made queries from your blog. To change the existing search bar into Adsense For Search, follow the below instructions.



1. For example this is the google adsense for search code :

<style type="text/css">@import url(http://www.google.com/cse/api/branding.css);</style><div class="cse-branding-bottom" style="background-color:#999999;color:#000000">  <div class="cse-branding-form">    <form action="http://www.google.com/cse" id="cse-search-box">      <div>        <input type="hidden" name="cx" value="partner-pub-0000000000000000:tx378i-lu0l" />        <input type="hidden" name="ie" value="ISO-8859-1" />        <input type="text" name="q" size="18" />        <input type="submit" name="sa" value="Search" />      </div>    </form>  </div>  <div class="cse-branding-logo">    <img src="http://www.google.com/images/poweredby_transparent/poweredby_999999.gif" alt="Google" />  </div>  <div class="cse-branding-text">    Custom Search  </div></div>

2. Extract the following lines from the above code
<form action="http://www.google.com/cse" id="cse-search-box">      <div>        <input type="hidden" name="cx" value="partner-pub-0000000000000000:tx378i-lu0l" />        <input type="hidden" name="ie" value="ISO-8859-1" />        <input type="text" name="q" size="18" />        <input type="submit" name="sa" value="Search" />      </div>    </form>

3. Login to your blogger account, click Design and select  Edit HTML. Find the following lines:


      <form action='/search' id='searchform' method='get'>
<div>
<input class='txtField' id='searchbox' name='q' type='text' value=''/>
<input class='btnSearch' id='searchbutton' type='submit' value=''/>
</div>
</form>


Replace the code shown above with code in step 2. Then hit save template button and you're done!

Now you will be able to see that the default site search is replaced with adsense for search.

NOTE: Backup your template before making any changes.

Custom Search

3 comments:

Keylogger said...

Simply great!!! You have provided some very good information here. I will defiantly go for it. Thanks a lot for being so helpful. Keep sharing such stuffs.

aman said...

its fantastic,thanking you for this information.its so useful.

Anonymous said...

Thanks for the help..I had difficulty implementing it on my own...now see how beautiful it looks

Post a Comment

Please enter your name while commenting.

Related Posts with Thumbnails
 
Free Domain Full RSS - Comments RSS Computer Blogs - BlogCatalog Blog Directory Top Blogs Alitu.com - General Website Directory
Powered by Blogger