That requires you to have a bike where the current gear is recognized digitally and the bike has a standard way of getting that data to an external device (or it requires you to put a sensor on the gear lever). For that matter, it requires you to have a bike with a manual transmission. There's lots of electric bikes, bikes with fully automatic transmissions, and bikes that simply don't have the electronics (not to mention a standard way to interface with them).
Actually in thinking about it, if you had access (digitally) to the current gear, you probably also have tachometer and velocity data as well through whatever that connection is anyway.
On the other hand, a motion sensor works for all bikes and is quite robust.