So I'm trying to set the query parameters and category parameters for google custom search. Here is an example search results page url:
http://www.whiterootmedia.com/search_results/index.html?q=my%20search%20phrase
So it looks like the default query parameter is q
so I put q
in the box when setting up the analytics portion for my google custom search engine. Is this ok? I read it wasn't ok to use q
but to instead use query
? And why does it matter?
Also should I set a category parameter that looks to be optional.
Thanks, Dusty
The Google Search API just uses q
. AFAIK the API doesn't have a query
parameter. Check out the custom search API documentation.
Not sure what you mean by the 'category' parameter. Haven't come across that one before.
HTML:
<gcse:search gname='google1'></gcse:search>
Javascript:
window.google.search.cse.element.getElement("google1").execute("hello world");
But you need to wait for the Google script to load before launching the javascript.
If you use searchresults-only instead of search, you also need to enable the correct layout in the CSE Control Pannel: https://www.google.com/cse/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With