It can be made ethical if we state at a visible location in the site that - "your actions are recorded for improving experience of the site" Or such message. So users know, they are being recorded. Just like we see similar messages while we are recorded in a shopping mall.
In my opinion, only if there's a popup before the recording begins and there's an option of opting out.
I don't find "You're being recorded by the way" to be a very welcoming indicator when I reach a website. If you ask, you may get consent, but if you just start recording you'll probably just end up in adblockers or people will leave your website.
As far as I know, where I'm from the warning about cameras in stores needs to be visible before you actually enter the field of vision. I'm sure stores don't care much about privacy, but the law and, in my opinion, ethics still say you should be given fair warning before you are recorded.
“Actions” typically refer to things as clicks/page navigation or button presses. The majority of people don’t expect (and don’t even know) that sites can record mouse movements and unsubmitted keyboard input.