You can work out the polarity relatively easy with a volt meter.
Put the leads across the sensor and then bring a steal ruler or bolt up to and then past the sensor. You are looking for a positive voltage spike as the item come towards the sensor and then negative as it moves away.
If it is reversed then swap the meter leads over.
The positive meter lead then indicates the trigger pin and the other is the sensor ground.