Setting Up the Google Search Module

Search Module Overview

There are two different Search Modules that work together that you will need to make sure are configured correctly so that they can work without any hitches. The two modules are as follows:

  • Search Module: This is the one that lives in the header. When you configure this, there are two really important things:
    • First, point it to the page where you will publish the Google Search ModuleNote: This is the page where the full results will be displayed.
    • Second, and VERY IMPORTANT: there is a field in the config called "Search param name". Set this to "For use with the Google Search module".
  • Google Search: This is the module you will publish to the page where the full results are displayed. We will go over the configuration and setup for this module in the section below.

Configuring the Google Search Module

To make sure that the Google Search Module works correctly and displays correctly on your site you will want to follow these steps:

  • Make sure that you are logged into your SiteStacker Installation
  • Head over to the Site Planner component of your Site
  • Search for the Google Search Module in the Content Explorer pane
  • Double-click on the item and the Add / Edit Item window will pop up

Google Search Module Blank

  • There will be a link to obtain a new Google Search API Key. Click this and it will take you to this web page: https://cse.google.com/cse/all
  • Click on the "Add" button if you do not already see your website there
  • Put in the primary URL and submit it

Add Your Primary URL

  • Go to the link that says "Look and Feel", and select the layout of "Results Only"
  • Once that is done, click "Save & Get Code"
Choose Results OnlyThe embed code they give you has a bunch of stuff you don't need. All you need is the key. The key is the string of numbers and letters living between two quotations on this line:

var cx = '002177169827034531217:cnstujmihoq';

Code to Copy Full ScreenCode to Copy
 
Just copy the key part: 002177169827034531217:cnstujmihoq

Note: Do not use the key above, as this is just for demo purposes!
 
And paste it into the "Search API Key" field of the "Google Search Module" configuration window.

Add the Search API Key
Note: Don't forget to place the Google Search Module on the dedicated page for search results, and link to that page in the Search Module configuration window, and that's it; Search should now be working on your live site!

Modified on Tue, 19 Sep 2023 at 10:11 AM

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article

Make sure these features are added to your Site Stacker installation by learning how to run updates here!