My cages have plastic on the sides to hold in humidity. I glue a small rare earth magnet to the suction cup with hot glue, and hold it in place by putting another magnet on the outside of the plastic. It's not directly inside the cage, but close enough to get an idea of the humidity and ambient temp.
For the basking spot I use a different thermometer with a smaller probe. For that one, I make an opening with a phillips head screwdriver, and put a rubber grommet in the hole. I push the probe in place, and then push in the dripper line, works well for me.