Magento5 min lezen

How to embed Google Custom Search Engine in Magento

Door Hans op woensdag, 16 mei, 2012

In dit artikel

Magento Google Custom Search Engine

Magento Google Custom Search Engine

Increase your sales revenue through better search results, profit with better SEO and reduce the BPU with the implementation of Google Custom Search Engine (Google CSE) in your Magento webshop. Many Dutch people use Google as default search engine and feel familiar with the look & feel. So why don’t we copy the functionality and look & feel to our own webshop. In this blogpost I show you how to implement Google Custom Search Engine into your own webshop. This improvement can be done within 10 minutes. 

Good results in Google Analytics

Hans Kuijpers (me) implemented Google CSE for one of his customers condoom-anoniem.nl and the Google Analytics results showed an increase of sales revenue with almost 21%!

  • The bounce rate decreased with 2,5% : less visitors left the show after showing the search results. Probably because visitors receive more relevant search results.
  • The search refinement decreased with 8% : more people find quicker what they are looking for.
  • The sales revenu increased with 21% : visitors find quicker what they are looking for and the results shows bigger alternatives.

Our conclusion was that implementation of Google CSE on this webshop strongly contributes the conversion rate of the search engine on the website. And with that the sales of the webshop. Note: these are the results after 2,5 month compared with 2,5 month before that. Keep in mind that March and April normally aren’t great months compared with December and January. That’s why we are so pleased with the results and share the knowledge.

Step by step

Follow the steps below and enjoy the improvements of your conversion.

  1. Go to www.google.com/cse and start creating a Custom Search Engine. Make sure you’re logged in with your Google account.
  2. Follow the three easy steps
    1. Set up your search engine : Give your search engine a name and description. Add the sites to search and proceed to the next step.
    2. Try it out : alter the basic look & feel and test your search engine.
    3. Get the code : The shown can be used on your site but we leave it as is. We proceed with one of the “Next steps” since we want to change some code.
  3. Click on the link change the look and feel.
  4. Select the layout Results only and click the button Save & Get Code.
  5. Copy the code and go to the admin panel of Magento.
  6. Go to CMS > Static Blocks and create a new Block with “Google Custom Search Engine” as Block Title and “google-custom-search-engine” as Identifier.
  7. Disable the WYSIWYG editor (Show/Hide Editor) and paste the copied code. Before you hit the button Save Block make sure the status is set to enabled.
  8. Go to CMS > Pages and create a new Page with “Search results” as Page Title and “searchresults” as URL key. Select the store where this page should be active and set the status to enabled. Finally paste “{{block type=”cms/block” block_id=”google-custom-search-engine”}}” in content field and hit the button Save Page.
  9. With the result page ready we only have to change the search field top right on you website.
  10. Now open your SSH of (S)FTP and go to app/design/frontend/<your_package>/<your_theme>/template/catalogsearch/ and copy form.mini.phtml to it from the default theme in your package or from base/default/template/catalogsearch/ if it doesn’t exist in your default theme.
  11. Open form.mini.phtml and set action to /searchresults and your done. Or… when you don’t want to use Magento search at all you can also remove the auto complete functionality. It’s up to you.
  12. Save & Close when done and you’ re ready to test your changes.

Top right on every default Magento installation you can find the search field. With the changes made above the look and feel of this search field hasn’t changed only the functionality. Just use the search field like you normally would do. Instead of the Magento search results you receive Google search results embedded on your website. With the look and feel of your website.

Final words

A major difference with the look and feel of Magento search results is the absence of an Add-to-cart button. If you use a lot of configurable items this should not be a problem since you always have to make a side step to the productdetail page before you can add the product to your cart.

Using the tutorial above you can disable Magento search functionality. You are using Google as a search engine instead. This will save BPU on your Magento hosting at Byte Internet.

[widget id=”magereport_widget-5″ /]

Hi! Mijn naam is Dion, Account Manager at Hypernode

Wil je meer weten over Hypernode's Managed E-commerce Hosting? Plan je online meeting.

plan een een-op-een meeting tel:+31648362102

Visit Hypernode at