Instant Search Analytics Widget - Common things to track

What are typical things that you would want to track in Google Analytics using the instantsearch.js analytics widget?

There is some examples you show of what you could track in some commented out code from the source code.

Any common things you see individuals want to track?

1 Like

The analytics integration we’ve done through that widget is a generic way to send analytics services (Google Analytics, Kissmetrics, Segment.io, …) all the search queries that are done on an instantsearch instance. You just need to uncomment the service you want to enable.

To handle the find-as-you-type search, we debounce+send the user queries to those services after a few hundreds of keyboard inactivity.

Once you’ve uncommented the Google Analytics code, you’ll start seeing metrics being computed in the “Site-Search” section of your Google Analytics account. Don’t forget to enable the Site Search feature from there: https://support.google.com/analytics/answer/1012264. You can know more about all the metrics they compute by reading https://support.google.com/analytics/answer/1032321?hl=en.

Metrics include

  • Sessions with Search = The number of sessions that used your site’s search function at least once.
  • Percentage of sessions that used internal search = Sessions with Search / Total Sessions.
  • Total Unique Searches = The total number of times your site search was used. This excludes multiple searches on the same keyword during the same session.
  • Results Pageviews / Search = Pageviews of search result pages / Total Unique Searches.
  • Search Exits = The number of searches made immediately before leaving the site.
  • Percentage of Search Exits = Search Exits / Total Unique Searches
  • Search Refinements = The number of times a user searched again immediately after performing a search.
  • Percentage Search Refinements = The percentage of searches that resulted in a search refinement. Calculated as Search Refinements / Pageviews of search result pages.
  • Time after Search = The amount of time users spend on your site after performing a search. This is calculated as Sum of all search_duration across all searches / (search_transitions + 1)
  • Search Depth = The number of pages viewed after performing a search. This is calculated as Sum of all search_depth across all searches / (search_transitions + 1)
3 Likes

Great, thanks @sylvain!

I assume that services like Google Analytics won’t see your queries, as you type, as a page result (being a purely front-end update of the query string params). Correct me if I am wrong here.

So you can push to GA /search/s=searchTerm as a page view, and thus see their updated search query that they did right on the page.

This has definitely given me some ideas on what to track :slight_smile:

1 Like

Yes, you’re right :thumbsup:

1 Like

How would you enable this within the Wordpress plugin?