Under the lid is easier, but you run the risk (probably slight) of compressing the wire (bad). Through the vents is better, but you have to plan for what to do when you remove the lid (pull the plug at the thermo).
Best solution, put in a grommet of some sort (I like the 3/8" lamp rod with a cover).
Rich