If the magnets have center holes for screws I would just use screws, no glue. Much easier to adjust the depth to get it just right. Set them a few thou below the surface so they don't make contact when the door is slammed closed which may happen if the magnetic force is too much. If the force is too strong set them a little deeper. If not strong enough, remember magnetic strength can be increased by backing the magnet with a steel disc (washer works) so drill deeper and add a washer behind or a second magnet. You can see how not gluing them in would make this much easier.