Do two actions with a button, it's possible?

It’s possible in some way to have a button that do two actions?
I mean… I have a button in a list that opens an external url the item have in a field of its record, but I want to register the clicks done in each item for the visitors (not necessary to show this counter in the web).
It’s possible to achieve this? I’m thinking in something that mix in some way the upvote functionality adding 1 to a field and then open the external url.
I’m looking for an snippet or something similar in this community posts and internet but with no success…

Thanks in advance.