Text selection tracking


(Carina Ro) #1

Hello :slight_smile:

does anyone know if you can track with matomo when the user is selecting text?

Thank you for your help

BR
Carina


(Lukas Winkler) #2

Hi,

You can track everything in Matomo in Matomo by writing a line of Javascript that sends an event when something happens that you want.

For tracking user copy events you could e.g. use something like this:

document.addEventListener('copy', function(e){
    _paq.push(['trackEvent', 'copy', 'something was copied']);
});

With text selection it may become more complex as there is no simple browser API for it, but it should still be possible.


(Fabian Dellwing) #3

Please note, that this feature is really unstable in some browsers.


(Carina Ro) #4

Thank you for your help! :sunny:
I will try something out and if I find something I’ll let you know! :slight_smile:
BR
Carina