« Previous | Next»

Seamless integration Google Search into Lifetype (Part 2)

Posted by coldtobi | 18 Jul, 2008, 22:34

This is the second part of the "seamless integration of Google Search into lifetype". To help you navigating, here are the links to oher parts: 

_ASIP_

To register for a Google CSE, you obviously need a Google account. If you go for the AdSense account or a simple CSE account does not matter.

gcse_create.pngFor AdSense, login and go to the AdSense Setup Tab. Choose "AdSense for Search" to get to the setup wizard. I won't explain everthing here, as most of the data you have to enter is self-explaining. So lets focus on the more important parts.

For exampe, if you want to limit the search results only to your sites, make sure to check "Only sites I select" and carefully enter the domains you want to be searched. Google supports wildcards. So "everything on coldtobi.de" is entered as coldtobi.de/*. (See here for details)

You can also use the optional keywords to fine-tune the search results. If your site is all about e.g Linux, you could enter Linux here. I personally do not use that feature, as my blog is to broad so I guess I simply won't know what to enter here. Afterall, this should be helpful for your reader, not only for best fitting the ads to your content...

But beside the optical tuning, there are some more important settings: Where to display the results. To get the results integrated into the blog, you defintly need the option that you want the results displayed on a dedicaed page. Note, in the CSE you have additionally check the option "in a iframe". Of course, you need a URL for the result page: You just need to enter your blog URL here. In my case, it is http://blog.coldtobi.de/index.php.

After naming your engine and accepting the Terms, you get your personal search engine code.

One is for the spot where to put the widget, and the other is the one to put on the result page: (note, this is only for reference. It won't work on your site, as the search engine is restricted to coldtobi.de)

<form action="http://blog.coldtobi.de/index.php" id="cse-search-box">
  <div>
    <input type="hidden" name="cx" value="partner-pub-2920186055509438:gvm6c13c2n5" />
    <input type="hidden" name="cof" value="FORID:10" />
    <input type="hidden" name="ie" value="ISO-8859-1" />
    <input type="text" name="q" size="16" />
    <input type="submit" name="sa" value="Search" />
  </div>
</form>
<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=en"></script>

The second code is supposed to go on the results page:

<div id="cse-search-results"></div>
<script type="text/javascript">
  var googleSearchIframeName = "cse-search-results";
  var googleSearchFormName = "cse-search-box";
  var googleSearchFrameWidth = 795;
  var googleSearchDomain = "www.google.com";
  var googleSearchPath = "/cse";
</script>
<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>

The CSE is now ready. The next step is now to prepare lifetype for the integration of this search engine. 

Blog and Website, Tips and Tricks, Monetizing A Blog | Comments (0) | Trackbacks (0)

Related Articles:

0 Comments | "Seamless integration Google Search into Lifetype (Part 2)" »