Insert the following function call within your JavaScript when searching within your website to track how visitors are using your internal search features.
In this example, the Event Action filters
is a comma-delimited list of search filter name/value pairs, and the Event Label orderedBy
is a string describing the user-determined sort order.
ga('send', 'event', 'Product Search', filters, orderedBy);
These events can then be viewed within Analytics under Behavior > Events:
Likewise, the searches can be viewed by Label to see how users are sorting their data: