Record view counter

Hey all,

I want to increase a view counter for whenever someone opens the detail view of one of my records. Any ideas how to achieve that?

My current idea is to increase the value by updating the record via JavaScript in the background. Any idea how this can be done?