Google‎ > ‎Sites‎ > ‎

Adding a Custom Search Engine in Google Sites

Heres how I got Google CSE working in my Google site www.shooshmonkey.com/blog

NOTE: Google Custom Search Engine won't work if your site hasn't been indexed by the Google, so submit a sitemap to get the ball rolling.

Here is the script I used and hacked with my details:

==========================================

<?xml version="1.0" encoding="UTF-8" ?> <Module> <ModulePrefs title="Shoosh Monkey IT Solutions CSE" /> <Content type="html"> <![CDATA[ <div id="cse-search-form" style="width: 100%;">Loading</div> <script src="//www.google.com/jsapi" type="text/javascript"></script> <script type="text/javascript"> google.load('search', '1', {language : 'en', style : google.loader.themes.MINIMALIST}); google.setOnLoadCallback(function(){ var customSearchControl = new google.search.CustomSearchControl('010428851484230611414:dbm31yqzwea'); customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); var options = new google.search.DrawOptions(); options.enableSearchboxOnly("http://www.google.com/cse?cx=016513948930280628187:wxbaovdq3ag", null, true); customSearchControl.draw('cse-search-form', options); }, true); </script> ]]></Content> </Module>

==============================================


Create the name for the gadget
This is easy, call it what you want.
title="Shoosh Monkey IT Solutions CSE"

Change the domain
I mine at google.com but you should probably change it to your location. ie. google.com.au
google.com/

Insert your public URL ID
This is found when you create your CSE, you can then get the code or public URL, click on the URL option and then pull the numbers that look like this after the cx= part:
cx=016513948930280628187:wxbaovdq3ag


Comments