Ever felt lost while browsing through the colossal list of products on online stores? You’re not alone! Due to increase in products on such websites day by day, users nowadays jump on to the search option to look for their requirements.
Providing a search box on your website not only helps your prospective customers, you too can benefit from it. By tracking how people use it, you can get important insights into user intent.
Site Search allows you to track how users use your website’s internal search engine. You can observe what keywords users typed on your website to search and whether they could get the desired pages after their search.
Why is it a must for your site?
- You get to know your customers’ actual requirements based on the keywords, phrases or the content they look for.
- You can discover what you’re not able to offer when users search for a keyword or a phrase several times.
- You get to know the trends of certain keywords.
- You can identify your SEO opportunities with the help of this.
Site Search Reports in Google Analytics:
Google Analytics has a Site Search report feature, located under “Behavior” in the left-hand navigation. Here is a sample site search “overview” report where you can see under “Search term”, what users are looking on your website.
The below available metrics in reports can give helpful insights.
Now let’s learn how to implement Site Search!
Method 1: Site Search with Query parameters:
This is the simplest way of site search tracking. This works when there are query parameters available in url; the url would look like this: http://www.tatvic.com/blog/?s=site+search+blogAs you’ll gather from the below steps, implementation is very simple!
- Go to Admin > View> View Setting tab. Here is a screenshot for reference.
- Under the site search settings, set the site search tracking to ON
- In the query parameter field, enter the word that denotes an internal query parameter like search, query, q, s.
- Select whether you want Google Analytics to strip the query parameter from your URL & show you the clean report without Query Parameters in Google Analytics Reporting section.
- Similarly, if you have passed on the category details as well within url, then in the Category Parameter field, enter the letters that designate an internal query category (Example: For shoes, men/women/kids are the internal category) such as ‘cat, qc,’.
Method 2: Site search without Query parameters – Using Filter
When there is no query parameter available in url, Method 1 will not work; the url would look like this: http://www.tatvic.com/search/site+search+blog/. For such scenarios, follow the below steps.
- Select the “Advanced” filter for the view you are using to track the site search report as shown in below image.
- Choose ‘Request URI’ for Field A, as you’ll be getting the information from the URI.
What happens here is, you ask Google Analytics to look at the page path and extract the characters from within the parentheses (). The dot (.) and asterisk (*) are regular expressions representing any character and any number of characters, so you can store anything after the slash.
- Leave Field B blank. The ‘Output To’ field will store the keyword from the URI. You need to output it to the correct dimension. In the dropdown menu, select ‘Search Term’ and type ‘$A1’ into the input box. This tells Google Analytics to grab the user-defined value from Field A and output it as a search term. For the checkbox options below, select ‘Field A Required’.
- Now you need to strip keywords from the URL. By stripping the entire URL in the search term, you’ll get the exact search term stored in the report. For this, you’ll have to use one more custom filter – Search and Replace.
Here, the search string “/search/site.*” will be replaced by “/search/site”, as you are stripping the keyword after the slash.
- Now you’ve successfully configured this in Google Analytics and data will start flowing into site search reports. Kindly note, your pages will no longer have keywords as you’ve replaced them into Search Term dimension of Google Analytics.
Method 3: Site search tracking in Google Tag Manager using Virtual pageviews:
Where URL does not contain search query parameters, Method 2 is the simplest solution. However, in cases wherein regex is too complex or not possible, there is another way out. It is tracking through Virtual Pageview. Under this method, we capture search term and search category from dataLayer & pass them with a pageview hit.
Let me try to explain this with one example.
URL 1: https://www.xyzmovies.com/buytickets/kaabil-ahmedabad/movie-ahd-ET00041703-MT/2017012 (can be tracked through RegEx)
URL 2: https://www.xyzmovies.com/buytickets/kaabil-national-capital-region-ncr/movie-ahd-ET00041703-MT/2017012
In the above example, “Kaabil” is the search term which is followed by search category values and “ahmedabad” & “national-capital-region-ncr”. Here in URL 1, regex could be simple, however in URL 2, regex could be challenging and a small mistake could distort the data. Hence, it is recommended to pass these values in the dataLayer as shown below:
Once these values are pushed to dataLayer, the next step is to create a Pageview tag that sends these details as a query parameter. Here’s the final outcome,
So, now in Google Analytics, repeat method 1 by using “search” as a keyword & “city” as a category to get the site search report populated correctly.
Choose an appropriate method depending upon the structure of your website and the URL pattern for search functionality. You will notice that these reports will be relevant not only to Web Analysts, but also for SEO, UX, and even your design team.
For more information on Site Search, feel free to contact us or drop a message in the comment section below. We will be glad to assist you!Use Internal Site Search to your advantage! Learn 3 ways to implement it in Google Analytics by Sasibhushan M