Installation of sensor on 2 inches deep door

I am trying to install the contact sensor on the basement exit door, but the door level and molding level are 2 inches apart (see the photo). I try to install magnet part of the sensor on the small area next to door jamb, but it is just a quarter inches width only and it blocks the door while opening. What is the easiest and proper way to solve this problem?

Hi @kgraghu. You can see some great examples of how to install this here.