Google custom search is double benefit tool for a webmaster.First it allows you to power search functionality of your website using best search engine.Second it allows you to make money from the search performed.
Looking at above benefit it is good to power search of your website using Google custom search.But it is also necessary to display search results from your website on page of your website.There are couple of reasons for it.
First displaying pages from your website only increases chances or more page views.Second displaying the search result on your website can also result in extra page view (good if you have CPM ads or CPC ads on that page other then ads displayed by Google on search page).Third it is good for user experience he will feel that he is on your website only.
If you are convinced and want to display Google custom search result on your webpage follow below steps
- Log into your Google Adsense account.
- Go to option search from My Ads to create Google custom search ad code.
- While creating the search ad under what to search option choose option only sites I select.Mention name of your website on the text box below.This causes only your website to be searched for the search query entered by visitor on the search box.
- Click On Search Results + button icon.On the drop down under Display result option select on my website using a Iframe.Mention URL of the search result page in the text box and set the width of Iframe.You will have to create a page on your website with same URL.So choose it with care.Below images show the screenshot of the search box ad code creator page
- Copy the generated code.
- There will be two part in generated code.First part (the top one) should be placed where you want to display search box on your website.
- Create a new page on your website and copy the second part.Remember you should be in HTML mode of your editor while pasting the code and without switching back to visual part publish the page.I might be unknowingly using WordPress terminology here so visitors using other CMS can map accordingly.
- You can now search your website to see the results in action.