The great thing about these door/window sensors is that you can have a significant gap in between the door sensor and its magnet. The two portions don't have to be perfectly flush with each other. Around one half of an inch of space can be in between the two portions, so the magnet can be a bit to the left or right of the sensor, or even a bit forward or backward from it, as long as you have the raised lines on the two cases generally near each other. Just make sure that the way in which you mount them causes the red LED to light up when the door or window is opened. This usually means that it is not necessary to cut into your trim in order to mount the sensor.