I think you should measure under the substrate, but keep in mind that's what you're doing, and get some kind of idea about how warm it is on the surface of the substrate compared to the reading on the thermometer. But then I think the big reason people usually say to do that is in case your snake burrows through the substrate, which isn't too likely in the case of carpet hehe.
I use a carpet with aspen on top, and I actually put it under the aspen, on top of the carpet.