An internal search is a specific type of action, and when an action is tracked as a Site Search, it does not count as a Pageview. There are three ways you can track a Site Search action:
Track Site Search using URL Parameters (default)
The easiest way to track internal search keywords, is to specify the URL parameter name that will contain the search keyword. By default, Matomo (Piwik) will read the URL and look for a parameter with any of the following names: q, query, s, search, searchword, k, keyword
The Super User can also specify the parameter names to use by default for all websites. Login as Super User, go to Administration > Websites (or Administration > Measurables), and look at the Site Search configuration at the bottom of the page.
piwikTracker.trackSiteSearch(keyword, category, searchCount). Calling the function will record the search keyword, search category, and the count of results on the search result page. This can be used on Search Results pages, instead of calling piwikTracker.trackPageView().
Track Site Search using the Tracking API (advanced users only)
Advanced users can also record Site Search requests using the Matomo Tracking API. See more information in the Tracking API Reference page. Specifically, look for the parameters ‘search’, ‘search_cat’ and ‘search_count’.
Tracking No Result Search Keywords
Would you like to benefit from the report “No Result Keywords”, listing all keywords that didn’t return any search result?
[...] var searchCount = 15; // set this value when rendering the search result page _paq.push(['setCustomUrl', document.URL + '&search_count=' + searchCount]); _paq.push(['trackPageView']); [...]
Matomo will then track for the site search query, the number of results, and will report all keywords with “zero” results in the “No Result Keywords” report.