Google Analytics Site Search Tracking Tutorial
Last Updated: September 5, 2023
Introduction to Site Search (or Internal Site 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.
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.
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:
- GET requests can be bookmarked. So a user can bookmark a search result page along with the search query/ category parameters.
- 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.
- 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’
- 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:
- POST requests can not be bookmarked. So a user can not bookmark a search result page along with the search/query parameters.
- 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.
- 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.
- You can not easily set up site search tracking for a POST based search engine.
- 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:
- Creating and using Site Search Funnel in Google Analytics
- Tracking Site Search without Query Parameter in Google Tag Manager
Other articles on specialized tracking in Google Analytics
- How to see Organic Search Keywords in GA4 (Google Analytics 4)
- Google Analytics Ecommerce Tracking Tutorial
- Google Tag Manager Event Tracking Tutorial
- Google Analytics Event Tracking Tutorial
- Google Analytics Store Visits Tracking Tutorial
- Offline Conversion Tracking in Google Analytics – Tutorial
- Ecommerce Tracking Google Tag Manager (GTM) – Tutorial
- Tracking Virtual Pageviews in Google Tag Manager – Tutorial
- Google Tag Manager YouTube Video Tracking
- Google Analytics Virtual Pageviews Tutorial
- Google Analytics YouTube Integration & Analysis Tutorial
- Google Analytics for Facebook Tutorial
- Cross Domain Tracking in Google Analytics – Complete Guide
- How to use two Google Analytics codes on one page
- How to correctly use referral exclusion list in Google Analytics
- Google Analytics Calculated Metrics – Tutorial
- Creating your own Google Analytics Tag Auditing System
- Google Tag Manager Search Tracking without Query Parameter
- Tracking Google Analytics Paypal Referral and other payment gateways
- How to Track Phone Calls in Google Analytics 4 – Call Tracking Tutorial
- How to track leads in Google Analytics via CRM
- Postbacks in Google Analytics Explained
- Subscription & Recurring Revenue Analytics in Google Analytics
- Track the Impact of Google Analytics Cookie Consent on Website Traffic
- Tracking Offline Conversions in Google Ads
- Implementing Scroll Tracking via Google Tag Manager
- Scroll Depth Tracking in Google Tag Manager – Tutorial
- Site Search Tracking In Google Analytics Without Query Parameters
- Google Tag Manager Youtube Video Tracking via YouTube Video Trigger
- How to Correctly Measure Conversion Date & Time in Google Analytics
- Google Analytics Social Tracking – Twitter, Facebook, Google Plus and LinkedIn
- Cross Domain Tracking in Google Analytics – Complete Guide
- Google Analytics Linkedin & Twitter Tracking
- Creating Content Group in Google Analytics via tracking code using gtag.js
- Google Analytics Site Search Tracking via Query Parameters
- Google Analytics Site Search Tracking Tutorial
- Creating and Using Site Search Funnel in Google Analytics
- How to add Facebook Pixel to Google Tag Manager
- AMP Google Analytics Tracking – Learn to track AMP pages
- Setting up Sales Funnel across websites in Google Analytics
- Google Analytics 4 Regex (Regular Expressions) 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.
Last Updated: September 5, 2023
Introduction to Site Search (or Internal Site 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.
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.
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:
- GET requests can be bookmarked. So a user can bookmark a search result page along with the search query/ category parameters.
- 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.
- 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’
- 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:
- POST requests can not be bookmarked. So a user can not bookmark a search result page along with the search/query parameters.
- 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.
- 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.
- You can not easily set up site search tracking for a POST based search engine.
- 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:
- Creating and using Site Search Funnel in Google Analytics
- Tracking Site Search without Query Parameter in Google Tag Manager
Other articles on specialized tracking in Google Analytics
- How to see Organic Search Keywords in GA4 (Google Analytics 4)
- Google Analytics Ecommerce Tracking Tutorial
- Google Tag Manager Event Tracking Tutorial
- Google Analytics Event Tracking Tutorial
- Google Analytics Store Visits Tracking Tutorial
- Offline Conversion Tracking in Google Analytics – Tutorial
- Ecommerce Tracking Google Tag Manager (GTM) – Tutorial
- Tracking Virtual Pageviews in Google Tag Manager – Tutorial
- Google Tag Manager YouTube Video Tracking
- Google Analytics Virtual Pageviews Tutorial
- Google Analytics YouTube Integration & Analysis Tutorial
- Google Analytics for Facebook Tutorial
- Cross Domain Tracking in Google Analytics – Complete Guide
- How to use two Google Analytics codes on one page
- How to correctly use referral exclusion list in Google Analytics
- Google Analytics Calculated Metrics – Tutorial
- Creating your own Google Analytics Tag Auditing System
- Google Tag Manager Search Tracking without Query Parameter
- Tracking Google Analytics Paypal Referral and other payment gateways
- How to Track Phone Calls in Google Analytics 4 – Call Tracking Tutorial
- How to track leads in Google Analytics via CRM
- Postbacks in Google Analytics Explained
- Subscription & Recurring Revenue Analytics in Google Analytics
- Track the Impact of Google Analytics Cookie Consent on Website Traffic
- Tracking Offline Conversions in Google Ads
- Implementing Scroll Tracking via Google Tag Manager
- Scroll Depth Tracking in Google Tag Manager – Tutorial
- Site Search Tracking In Google Analytics Without Query Parameters
- Google Tag Manager Youtube Video Tracking via YouTube Video Trigger
- How to Correctly Measure Conversion Date & Time in Google Analytics
- Google Analytics Social Tracking – Twitter, Facebook, Google Plus and LinkedIn
- Cross Domain Tracking in Google Analytics – Complete Guide
- Google Analytics Linkedin & Twitter Tracking
- Creating Content Group in Google Analytics via tracking code using gtag.js
- Google Analytics Site Search Tracking via Query Parameters
- Google Analytics Site Search Tracking Tutorial
- Creating and Using Site Search Funnel in Google Analytics
- How to add Facebook Pixel to Google Tag Manager
- AMP Google Analytics Tracking – Learn to track AMP pages
- Setting up Sales Funnel across websites in Google Analytics
- Google Analytics 4 Regex (Regular Expressions) 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.
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.