Adding Google Search Engine

Options
Does anyone have experience adding in the Google custom search engine into their BB site? Wondering where the code needs to be placed to integrate. Thanks for any assistance.
Tagged:

Comments

  • Scott Reuschling
    Scott Reuschling Blackbaud Employee
    Tenth Anniversary Facilitator 1 Photogenic
    Hi Amber!



    We have a Search part that can be used within NetCommunity.



    In order to create the NetCommunity Search part, we do the following:



    1. We click on Site Explorer > Parts.


    2. We click the green button that says New Part.


    3. Under Part type, we select Search.


    4. Under Part name, we can call it something like Site Search.


    5. We click Next.


    6. On the Design tab, we select our search properties and we click Save.



    We are now ready to insert this part into the page or template that we want it to display on.



    However, if you wish to use Google Custom Search instead, I'm happy to provide you with some steps on getting that into your site. Please bear in mind that because this is a Google script, we aren't able to troubleshoot it in case you have any issues.



    Our first step is to generate a custom search engine with Google. We can do that by going to: https://www.google.com/cse/all.



    Once we've completed that step, Google will provide us with its code. You may have already done this, but it will generally look something like this (with the numbers being different):



    <script> <br /><br/> (function() { <br /><br/> var cx = '897238457283402379:vihroqb1wj0'; <br /><br/> var gcse = document&#46;createElement('script'); <br /><br/> gcse&#46;type = 'text/javascript'; <br /><br/> gcse&#46;async = true; <br /><br/> gcse&#46;src = (document&#46;location&#46;protocol == 'https:' ? 'https:' : 'http:') + <br /><br/> '&#47;&#47;www&#46;google&#46;com/cse/cse&#46;js?cx=' + cx; <br /><br/> var s = document&#46;getElementsByTagName('script')[0]; <br /><br/> s&#46;parentNode&#46;insertBefore(gcse, s); <br /><br/> })(); <br /><br/></script> <br /><br/><gcse:search></gcse:search>



    In order to add it to NetCommunity, we need to insert this code within an Unformatted Text part within the template or page that we want it to display on.



    1. We create the Unformatted Text part by going to Site Explorer > Parts.


    2. We click on the green button that says New Part.


    3. Under Part type, we select Unformatted Text part.


    4. Under Part name, we can enter something like Google Custom Search.


    5. We click Next.


    6. We copy and paste our code that Google gave us in the box.


    7. We click Save.



    We are now ready to insert this part into the page or template that we want it to display on.
  • Thank you Scott! I really appreciate your response and was able to add the Google custom search engine to our testing site. Now I realize upgrading to the "site search" version would be better.



    Now we are noticing the search results aren't including everything - time to check the tagging!



    Thanks for helping us make progress on this project. We are familiar with the BB search feature but as we have a significant number of PDF documents we are trying the Google route. We're also exploring the possibility of converting our PDFs to web pages.



    Do you know of any future plans for NetCommunity to include PDFs in the search results?



    Thanks again!!

Categories