eea / volto-matomo

Matomo integration for Volto
MIT License
3 stars 1 forks source link

Extend tracking for internal site search #28

Closed fredvd closed 1 year ago

fredvd commented 1 year ago

The current implementation only logs page views to the Matomo tracking API. One very important and valuable feature in Matomo is to track the internal site search: what do visitors search for in our on site search fields?

With ClassicUI Plone this is very easy as you can configure url params in the Matomo website profile that contain search site params. So you can set "SearchableText" text here and all requests with this URL param are considered to be search and added to the search results add'on.

For Volto we need to do extra calls in the tracking API. Fortunately these are all document and available in Matomo: https://developer.matomo.org/api-reference/tracking-api#optional-action-info-measure-page-view-outlink-download-site-search

I see that utils.js already has a trackSiteSearch method, but it is not yet called anywhere from the MatomoAppExtra. Also we see no site search tracking in our current Plone foundation sites where we use this plugin.

@avoinea @tiberiuichim @nileshgulia1 Is this low hanging fruit to be implemented or does it need more work. Didn't you have this requirement already or is Matomo not that seriously used by installed base?

cc: @ericof @rioksane Marketing-Team

tiberiuichim commented 1 year ago

@fredvd I'd consider our use of matomo in the "light" category. I think this will change in the near future, as our use cases get more complicated.

If anyone starts working on your issue, I'd suggest creating a middleware / reducer on the searchContent action that can call matomo api.

avoinea commented 1 year ago

Merged