The farther back you put it, the more lag there will be with the response. Placing the sensor at the end of the downpipe/beginning of the midpipe seems to be the best compromise between heat and lag.
Sensor orientation is very important. The sensor usually is required to be within 15 degrees of vertical. You can read through Chris Regan's write-up. It's very thorough, as are all his write-ups: