I've velcroed a small button compass to the top surface of my front mudguard. It isn't affected by any metal parts there. I tried placing it elsewhere but it didn't give an accurate reading. They cost about a quid so I'm not worried if it gets nicked. I find a compass is very useful for getting out of cities.