Reporting search keywords to Google Analytics

Search pages are one of the most visited pages of your WebStore. It is therefore vital to keep track of the keywords that were entered by your visitors.

We recently updated our Analytics code to automatically report those keywords to Google. This functionality does not require any extra configuration from your side and is included as soon as the Google Analytics integration is enabled in the WebStore Manager. This is shown in the next picture:

It typically works by adding the following code snippet to Analytics code:

_gaq.push([‘_trackPageview’, ‘/search.asp?q=clay+cross’]);

In this example, the visitor is searching for items using the keywords clay cross. These were appended to the dynamically created URL.

Having sent this request, your reports on the Google site will look like this the following screenshot:

Further information on this reporting as well as customizing the display can be found at this link: [UA] Set up Site Search - Analytics Help

2 Likes

Having this feature is brilliant and helps us understand what our customers call things and how they search for them.

We have discovered that a lot of people search our site for things using double quotes (“) in the search string (to mean inches) eg
3” door knob

This seems to cause chaos, and brings back everything that contains a 3 - whether that be door knobs or lights or whatever.
I can’t think of any reason why anyone would want that- shouldn’t it ignore the " character and search for ‘3 door knob’ which would give the exact results the end user requires?
Thanks

Hi @emma,

You certainly have a case and we will update our code accordingly.

Regards,
Franclin

I’ve been trying to extract keywords from the URL’s so that I can have a report of what is being typed into our website but I’m not having any luck. Is this up to date information what is in the query parameter is : search.asp,filtered search,store,search.asp?keyword,keyword

What I have in category parameter is: advanced search,advsearch.asp

Hi @webmaster1

The URL for search pages is indeed different depending on the context in which it is being used.

Here are some examples:

  • In a normal search, that is the user has entered a keyword in the search box, the URL will be something like: yourstore.com/store/search.asp?keyword=mykeyword* In this case, the request is sent to our servers using a GET HTTP request and that’s why the keyword is appearing in the URL so you can easily extract that from the query string

  • For advanced search, the request is routed to /store/advsearch.asp via a POST and the form data is something like: submitted=1&hideoptions=0&product_keywords=mykeyword&product_code&product_departmentid&product_categoryid&product_subcategory&product_brandname&product_price_gte&product_price_lte&_product_image_ne_submitted=1&_product_stock_gte_submitted=1 Parsing this form data to extract the relevant information should be straightforward

  • If you’re using filtered search, the URLs are different and look like: /store/filtered/k_mykeyword/ct1_a181a603769c/ in this instance, search filters are appended in the URL and the keywords can be found in k_mykeyword so you can extract the keyword there.

I hope to have shed more light on this issue, if not please feel free to let me know.

Regards,
Franclin

Hi @webmaster1,

Do you have it enabled properly on the analytics side as well as enabled in Nitrosell? Ours works fine with the following settings in Analytics:
In Admin in View Settings, enable “Site search Tracking”
In the query parameter field enter a “q”, and tick to “Strip query parameters out of URL”

You then have data automatically populating all the Site Search reports in the Behaviour section of Analytics.

Good luck, hope that helps.
Emma

1 Like