cooling

hi,can anyone help me,have a 1.6 zetec 3 door ,coolant is bubbling in header tank and cooling fan is not cutting in,but both fans work when ac is switched on,checked fuses,changed relay.was told it could be fan sensor if so were is this situated.thanks for any help.when ac switched on coolant stops bubbling in header tank.