Google Analytics Site Search Tracking Tutorial

Introduction to Site Search (or Internal Site Search)

site search tracking search

Site search is a functionality provided by a website in the form of a search box through which website visitors search the website for information or products.

If your website provides site search functionality then you should set up ‘site search tracking’ in Google Analytics.

Introduction to Google Analytics Site Search Tracking

Through Google Analytics site search tracking you can determine:

  • The web pages from which visitors started their search on your website (start pages)
  • The search terms used by website visitors to find information on your website.
  • The search categories used by website visitors
  • The web pages visitors saw after clicking on one of the search results on the search result page (i.e. search destination pages)
  • How effective the search results were in driving user engagement, sales and conversions.

site search tracking start page

With this insight, you can determine missing contents on your website i.e. the contents which should be there (a lot of visitors search for it) but are not there.

By analyzing site search reports you can improve the quality of search results for key phrases and develop a better user experience. You can also identify new keywords for your search marketing campaigns (SEO and PPC).

You can create site search funnels in Google Analytics and use it to understand the users’ intent and optimize your website for traffic and conversions.

attribution modelling

Get the E-Book (52 Pages)

62 point checklist

Get the E-Book (50 Pages)

Introduction to search query and category parameters

A query string is the part of the URL which comes after the ‘?’ character. For example in the URL:

https://www.optimizesmart.com/?s=enhanced+ecommerce

The query string is: s=enhanced+ecommerce

A query string is made up of one or more ‘key=value’ pairs. For example in the query string: s=enhanced+ecommerce

The ‘key’ is ‘s’ and the ‘value’ is ‘enhanced+ecommerce’

The key which represents a search term is called the search query parameter.

The key which represents a search category is called the search category parameter.

For example, consider the following URL:

https://www.optimizesmart.com/?s=enhanced+ecommerce&cat=ecommerce

s’ is the search query parameter.

cat’ is the search category parameter.

A search query parameter can be any combination of characters. Following are examples of valid query parameters:

  • keywords
  • term
  • q
  • s etc

Similarly, a search category parameter can be any combination of characters.

If your website has got a site search box then perform a search on your website. Now analyze the URL of the search result page.

If your website site search functionality uses a search query parameter then most likely it will append the query parameter to the search URL.

Similarly, if your website site search functionality uses a search category parameter then most likely it will append the category parameter to the search URL.

However, these days more and more websites are being built whose internal site search does not use query or category parameters. The search term is either present in the URL (but without query/category parameter) or it is not present at all.

Following is an example of a search page URL which contains the search term in the URL but without the query parameter:

https://www.optimizesmart.com/search/enhanced+ecommerce

Following is an example of a search page URL which contains both the search term and the search category in the URL but without query and category parameters:

https://www.abc.com/search#shirts&categories_02

Following is an example of a search page URL which does not contain: search term, search query/category parameter in the URL:

https://www.optimizesmart.com/search/

Ask your developer, if you are not sure what your query and category parameters are.

Introduction to GET based search engine

An internal search engine like the one used on your website can use GET or POST method to send search information from a user’s web browser to your web server.

If your internal site search engine uses the GET method to send the search information from the user’s web browser to your web server then you are using the GET based search engine

In the case of GET based search engine, the search information is sent from a user’s web browser to your web server via the URL. Because of this reason, the search term and search query/category parameters appear in the search page URL.

There are no security implications of using the GET method for internal site search unless you are sending sensitive data (like usernames, passwords, etc) along with the search information. 

If you are using internal site search on your website, it is wise to use the GET method because of the following reasons:

  1. GET requests can be bookmarked. So a user can bookmark a search result page along with the search query/ category parameters.
  2. GET requests can be cached and they remain in the browser history. Thus making it easy for your website users to return to the last search result page on your website.
  3. You can use a search result page as a landing page for your PPC campaigns. In this way you can create highly targeted campaigns like: ‘Men polo shirt white’
  4. You can easily set up site search tracking for a GET based search engine in Google Analytics.

Related Article: Tracking Site Search for GET-Based Search Engines in Google Analytics

Introduction to POST based search engine

If your internal site search engine uses the POST method to send the search information from the user’s web browser to your web server then you are using the POST based search engine.

In the case of POST based search engine, the search information is sent from the user’s web browser to your web server within the body of the HTTP request and not via the URL. Because of this reason, the search term and search query/category parameters do not appear in the search page URL.

POST method is generally used when you want to send sensitive data from the user’s web browser to your web server. For example, if you want to send the submitted form data to your web server then you use the POST method (and not the GET method)

If you are using internal site search on your website, it is wise not to use the POST method because of the following reasons:

  1. POST requests can not be bookmarked. So a user can not bookmark a search result page along with the search/query parameters.
  2. POST requests can not be cached and they do not remain in the browser history. Thus making it impossible for your website users to return to the last search result page on your website.
  3. You can not use a search result page as a landing page for your PPC campaigns. So you won’t be able to create highly targeted PPC campaigns.
  4. You can not easily set up site search tracking for a POST based search engine.
  5. Search information (search query terms, search categories) is hardly classed as sensitive information, so a POST based search engine is not really required.

The only real advantage of using a POST based search engine is that POST requests have no restriction on the size of data you can send from the user’s web browser to your web server.

So if your query string is crazy long with a lot of parameters then it makes sense to use the POST based search engine.

However, instead of using crazy long query strings, use clean and short URLs. Not only are they SEO and user-friendly, they will also let you use the GET based search engine on your website.

Related article: Setting Up Site Search Tracking for POST based search engines in Google Analytics

Other Articles you will find useful:

Other articles on specialized tracking in Google Analytics

  1. Google Analytics Ecommerce Tracking Tutorial
  2. Google Tag Manager Event Tracking Tutorial
  3. Google Analytics Event Tracking Tutorial
  4. Google Analytics Store Visits Tracking Tutorial
  5. Offline Conversion Tracking in Google Analytics – Tutorial
  6. Ecommerce Tracking Google Tag Manager (GTM) – Tutorial
  7. Tracking Virtual Pageviews in Google Tag Manager – Tutorial
  8. Google Tag Manager YouTube Video Tracking
  9. How to unlock not provided keywords in Google Analytics?
  10. Google Analytics Virtual Pageviews Tutorial
  11. Google Analytics and YouTube Integration Tutorial
  12. Google Analytics for Facebook Tutorial
  13. Cross Domain Tracking in Google Analytics – Complete Guide
  14. How to use two Google Analytics codes on one page
  15. The one thing that you don’t know about PayPal.com and the referral exclusion list
  16. Google Analytics Calculated Metrics – Tutorial
  17. Creating your own Google Analytics Tag Auditing System
  18. Google Tag Manager Search Tracking without Query Parameter
  19. Tracking Google Analytics Paypal Referral and other payment gateways
  20. How to Track Phone Calls in Google Analytics – Call Tracking Tutorial
  21. How to track leads in Google Analytics via CRM
  22. Postbacks in Google Analytics Explained
  23. Subscription & Recurring Revenue Analytics in Google Analytics
  24. Track the Impact of Google Analytics Cookie Consent on Website Traffic
  25. Tracking Offline Conversions in Google Ads
  26. Implementing Scroll Tracking via Google Tag Manager
  27. Scroll Depth Tracking in Google Tag Manager – Tutorial
  28. Site Search Tracking In Google Analytics Without Query Parameters
  29. Google Tag Manager Youtube Video Tracking via YouTube Video Trigger
  30. How to Correctly Measure Conversion Date & Time in Google Analytics
  31. Google Analytics Social Tracking – Twitter, Facebook, Google Plus and LinkedIn
  32. Cross Domain Tracking in Google Analytics – Complete Guide
  33. Google Analytics Linkedin & Twitter Tracking
  34. Creating Content Group in Google Analytics via tracking code using gtag.js
  35. Google Analytics Site Search Tracking via Query Parameters
  36. Creating and Using Site Search Funnel in Google Analytics
  37. Learn to Setup Facebook Pixel Tracking via Google Tag Manager
  38. AMP Google Analytics Tracking – Learn to track AMP pages
  39. Setting up Sales Funnel across websites in Google Analytics
  40. Regex Google Analytics & Google Tag Manager – Tutorial

Frequently asked questions about site search tracking

What is a site search?

Site search (or internal site search) is a functionality provided by a website in the form of a search box through which website visitors search the website for information or products.

Do I need to set up site search tracking?

If your website provides site search functionality then you should set up ‘site search tracking’ in Google Analytics.

Through ‘site search tracking’ in Google Analytics you can determine:
– The web pages from which visitors started their search on your website (Start pages)
– The search terms used by website visitors to find information on your website.
– The search categories used by website visitors
– The web pages visitors saw after clicking on one of the search results on the search result page (i.e. search destination pages)
– How effective the search results were in driving user engagement, sales and conversions.

What is a query string?

A query string is the part of the URL which comes after the ‘?’ character. For example in the URL:
https://www.optimizesmart.com/?s=enhanced+ecommerce
The query string is: s=enhanced+ecommerce

Should my site search be GET-based or POST-based?

If you are using internal site search on your website, it is wise to use the GET method for the following reasons:

– You can easily set up site search tracking for a GET based search engine in Google Analytics.
– GET requests can be bookmarked.
– GET requests can be cached and they remain in the browser history.
– You can use a search result page as a landing page for your PPC campaigns.

There are no security implications of using the GET method for internal site search unless you are sending sensitive data (like usernames, passwords, etc) along with the search information.

POST method is generally used when you want to send sensitive data Also, the POST method has no restriction on the size of data you can send from the user’s web browser to your web server.

Register for the FREE TRAINING...

"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."



Here’s what we’re going to cover in this training…

#1 Why digital analytics is the key to online business success.

​#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.

#3 Why Google and Facebook ads don’t work for most businesses & how to make them work.

#4 ​Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.

#5 The number 1 reason why conversion optimization is not working for your business.

#6 How to advertise on any marketing platform for FREE with an unlimited budget.

​#7 How to learn and master digital analytics and conversion optimization in record time.



   

My best selling books on Digital Analytics and Conversion Optimization

Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.

Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.

Attribution Modelling in Google Analytics and BeyondSECOND EDITION OUT NOW!
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.

Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.

About the Author

Himanshu Sharma

  • Founder, OptimizeSmart.com
  • Over 15 years of experience in digital analytics and marketing
  • Author of four best-selling books on digital analytics and conversion optimization
  • Nominated for Digital Analytics Association Awards for Excellence
  • Runs one of the most popular blogs in the world on digital analytics
  • Consultant to countless small and big businesses over the decade
error: Alert: Content is protected !!