Without a picture of the application it's tough to see the actual problem. But is sounds like a simple mechanical problem, of mounting the magnet without using a strong adhesive.
Possibly you can improvise a pocket, maybe by cutting up a blister package of the right size and shape, with extensions to either side of the magnet, Pocket the magnet, and use wire ties to hold the assembly to the chainstay. You might add a sheet of rubber (cut up a balloon) underneath for traction.
If the magnetic pull isn't strong, you might push the magnet into a short length of rubber or vinyl tubing, and use the cable ties o hold it on, closing both ends right up against the magnet.
__________________
FB
Chain-L site
An ounce of diagnosis is worth a pound of cure.
Just because I'm tired of arguing, doesn't mean you're right.
“One accurate measurement is worth a thousand expert opinions” - Adm Grace Murray Hopper - USN
WARNING, I'm from New York. Thin skinned people should maintain safe distance.