On rockauto.com, I'm seeing the sensory number as #222040T020 for the 1.8 VVT-i
And these part numbers for the 2.4 VVT-i: #222040H010 or 2220431020
You need to get the right sensor, and I would buy a new connector, as they will come with factory matching wiring that you can splice in...