Have you not seen these things? It's a weighted magnetic sphere floating inside a clear plastic outer sphere. Anywhere you can stick the suction cup to, the compass reading will be roughly horizontal.
Here's an example https://www.amazon.com/example/dp/B0FZSFWJQR that I'm not endorsing.