1.0 Sign up for a Google Custom Search Engine
1.1 Log in to your Google/Gmail account and go to
Google Custom Search Engine - Site search and more
1.2 Click
Create a Custom Search Engine
1.3 Complete the
Basic information fields as desired
1.4 Select
Only sites I select from the
What do you want to search? options
1.5 In the
Sites to search field, enter the URL's, domains, and subdomains you would like the custom search engine to index or enter wildcards to indicate that all URL's on all subdomains should be included
Examples
Code:
domain.com/index.htm
domain.com/*
sub.domain.com/*
*.domain.com/*
1.6 Select whether you wish to use the "free" option (ads will display with results) or the Business edition ($100/year) of Google Custom Search Engine
1.7 Finalize the setup process and you will arrive at the
My search engines page - follow the
control panel link to manage settings for your custom search engine
1.8 Click the
Look and feel option from the left-hand navigation menu and select
Iframe under
Choose a hosting option
1.9 Update and customize the search results style to your preferences, then click
Save to store your customizations
1.10 Click
Get Code and save a copy of the
Search box code and the
Search results code for use on your site
2.0 Integrate the Google Custom Search Engine code with your CMS
Your Google Custom Search Engine relies upon two blocks of code for integration into your site:
- Search box code - Draws a form and calls a Javascript file which will draw the Google logo into the form (amongst other things)
- Search results code - Draws the search results IFRAME (amongst other things)
2.1 Basic Integration (Javascript Required)
You can copy the search box code into your CMS template so it appears on every page and create a new page devoted to the search results code (follow the instructions at the Google Custom Search Engine > Control Panel > Get code page) and you'll have a working custom search engine for site visitors who have Javascript enabled.
For the purposes of the examples below, the code Google provides isn't exactly ideal (it doesn't provide a Javascript-free search method) - I'll be working with modified code blocks, so wherever you see the following lines you will want to replace them with the similar lines from your code blocks:
Search box code
Code:
<input type="hidden" name="cx" value="000000000000000000000:abcd_efghi" />
<input type="hidden" name="cof" value="FORID:10" />