Jump to content

Search parameters in search results link - google analytics


Noni

Recommended Posts

I'd like to implement in google analytics the site search query parameters tracking according to the guide:

However, the search page results does not display query parameters. Is there a way to set this up correctly?

 

https://support.google.com/analytics/answer/1012264?hl=en#Params

Set up Site Search

Site Search must be set up for each reporting view in which you want to report on user search activity. To set up Site Search for a view:

  1. Sign in to your Analytics account.
  2. Click Admin, and navigate to the view in which you want to set up Site Search.
  3. Click View Settings.
  4. Under Site Search Settings, set Site Search Tracking to ON.
  5. In the Query Parameter field, enter the word or words that designate internal query parameters, such as term,search,query. Sometimes query parameters are designated by just a letter, such as s or q. Enter up to five parameters, separated by commas. Do not enter any additional characters: for example, if the query parameter is designated by the letter q, enter only q (not q=). Read How to identify search query parameters, below.
  6. Select whether or not you want Analytics to strip the query parameter from your URL. This strips only the parameters you provided, and not any other parameters in the same URL.
  7. Turn Site search categories on or off. If your site lets users refine searches, you can include that information in your reports. For example, users might search for "chromebook" once they've refined the category to "laptops". In a case like this, the site-search URL would look something like ...?q=chromebook&sc=laptop.

    If you leave categories OFF, you are finished. Click Save.

    If you turn categories ON:
    • In the Category parameter field, enter the letters that designate an internal search category such as 'cat,qc,sc'. As you did with the Query Parameter field, enter only the characters for the parameter, e.g., "sc", and not "sc=".
    • Select whether or not you want Analytics to strip the category parameters from your URL.
      Note that this strips only the parameters you provided, and not any other parameters in the same URL. This has the same effect as excluding URL Query Parameters in your master reporting view: if you strip the category parameters from your Site Search view, you don't have to exclude them again from your master view.
    • Click Save.

How to identify search query parameters

When users search your site, their queries are usually included in the URL. For example, if you use Google to search the phrase Mountain View, you see q (Google's query parameter) followed by your query:

http://www.google.com?hl=en&q=mountain+view...

If your site uses categories, then the same principle applies. You can also contact your webmaster to identify the query parameter for your site.

Setting Up Site Search for POST-Based Search Engines

If you're using a POST-based search engine, the search-results URL would look something like:

http://www.example.com/search_results.php

 

You have two options to use Site Search for POST-based search engines:

Option 1: Configure your web application to append the query keywords to the end of the URL (e.g., http://www.example.com/search_results.php?q=keyword) and then set up Site Search as described in the previous section.

Option 2: Customize the tracking code on your results page to dynamically specify a virtual page path that includes the query keywords. The tracking code on the results page would look something like:

analytics.js: ga('send', 'pageview', '/search_results.php?q=keyword');

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...