Capturing search details from Confluence

We have an on-premise Confluence (7.3) installation we’d like to gather metrics on. I’ve installed the latest version of Matomo and instrumented Confluence globally with the javascript tracking code. I configured the site as an intranet option and have site search tracking enabled. I’m seeing hits in the dashboard in Matomo, but when I go to Beahviour --> Site Search I’m not getting any data. Can anyone suggest what the next steps to check to get search data showing up? When I open the browser tools I can see search requests going to URLs like https://wiki.example.com/rest/api/search?cql=XXXX for the quick popup search. Advanced searches go through URLs like https://wiki.example.com/dosearchsite.action?cql=XXXX.

Confluence has different search methods. In general, you have the autocompletion (showing results while you’re typing) and a real result page if you press “Enter”.

The second one, you can easily track, if you add the parameter “text” to the default parameters that should be tracked as search (in the Manage Websites section).

The autocompletion is more complicated. As the person searching for an issue gets results while typing, you have to listen to changes to the field with an event listener (example):

const inputField = document.getElementById('input-search'); //use the real elemt identifier here

const inputHandler = function(e) {
  //track Event / trackSearch here with filters (e.g. from 3 chars upwards) as you don't want to track every single keystroke here
}

inputField.addEventListener('input', inputHandler);

Thanks for the guidance @peterbo. It appears the inputField value is going to be search-filter-input based on what I see in the browser tools. I’m not a developer so the inputHandler section is a little confusing to me. Do you have any examples I can look at? Would using tag manager also be an option to gather the autocomplete data?