WordPress URL after search has a format like
It is not possible to remove a query parameter from URL in Google Alanytics - all
search URLs would be displayed as homepage then. That is the reason for it is advisable
to change the URL and track a virtual pageview in format
In addition, if a function which returns the number of search results is defined, searched term and result count will be automatically tracked as event. You can trace easily frequently searched terms for which site search does not find any results.
It is needed to create a route and add it to
_gas object via
addRoute method. Creating a route might look like this:
Route constructor has 2 optional parameters.
_trackPageviewis sent. Function is executed only once even if more trackers are created.