Google Product Forums

Re: how to add session id to url

omr Apr 30, 2012 1:17 AM
Posted in group: Google Custom Search

Categories: Implementation :


In addition to your results code, do you also use Custom Search Element code for your search box?  Do you pass the results page URL as an argument to the enableSearchboxOnly method?

In that case please see the "DrawOptions Object" section in Custom Search (Element) JavaScript API documentation:

  https://developers.google.com/custom-search/docs/js/cselement-reference#csedrawoptions-el

In that section there is a tabular list of methods of the DrawOptions object.  Find the description of the enableSearchboxOnly method.  In the rightmost column, note the following:

  "... If the result page prefix does contain a ? with a query parameter, you can specify additional query parameters ...."


Alternatively (if you do not use Custom Search Element code for your search box):

Is your search box implemented as a simple HTML form element, with an action attribute specifying the results page URL?  In that case, you can add a hidden input field to the form, e.g.:

  <input type="hidden" name="sid" value="...">

-- omr