Upgrade users

We are looking at a pricing model that restricts features based on user roles but want to be able to track when someones clicks on a feature they don’t have access to in an attempt to upgrade (similar to HubSpot). Any suggestions on how to do this?