seo tips, blogging tricks, widgets and gadgets for you blog

Wednesday 14 March 2012

embed-custom-google-search-in-blogger


Sign in to Google

Before you can create a Google Custom Search you need to have a Google Account. You may already have one for Gmail, Google+ or another one of Google's services.
If you have an AdSense account then it would be best to use that. You can then associate your Google Custom Search with your AdSense account to get paid from the adverts in the search results.
If you don't have an account yet, you can create a new one here:
https://www.google.com/accounts/NewAccount 
It's quite a simple form. All your really need is an email address. Don't forget to note down the email address and password you used!

Create your Custom Search Engine

Once you have signed into your Google Account you can start to create a Custom Search Engine by going to the Google Custom Search  page.
Just click on the New Search Engine... link to get started.
Fill in details requested. In particular the sites you want it to search through. Then click Next.
Here you need to chose a Style. Don't worry to much now, as you can always change it later. If you are CSS savvy you can customise it as well. Click on a Style to see a preview of it, which you can actually test to see if what sort of results Google will display. Once you have chosen your theme then click Next.

The Search Code

By default Google provides code that you can use to add to a dedicated search page. This is the simplest option. With this you create a new page on your website and add the provided code into it. You can then add "search" links to it from the other pages of your website, and your done. Visitors have to go to the search page (via those links) in order to perform a search.
If you wish to have a more integrate search where search boxes are embedded on every page, then click on the Look and feel link near the top...

Embedded Search Boxes (look and feel)

There are several Look and feel Layout options that you can use to change the way the Google Search Engine works. The default is Full-width which lets you display the search results on the same page as the search box.
My favourite is the Two page option, which is what is used on this website (see top right). This option lets you embed a search box on every page. When a visitor searches using it they are sent to a dedicated search page to see the results.
It even suggests refinements to your search as you type.
To use the Two page option, go to the Look and feel section and select Two page as your layout. Then click the Save & Get Code... button. Here you will need to enter the URL of the page you are going to use to display the search results. Create that search result page and embed the provided Search results code into it. Finally add the Search Box Code to all the pages on your website (a good place would be in a common header if your website is template driven).


0 comments:

Post a Comment