I have a 2004 2500HD 6.0l Gas and am having a problem with the rear o2 sensors. I had the driverside rear sensor clip holding it to the frame come loose and cause the connector to get in the driveshaft. This caused all the wires to be pulled out of the sensor and the truck side connector to be ripped off. So now all i have is the 4 wires hanging from the truck wiring harness. I purchased a Bosch Universal Sensor and hooked it up this way by comparing it to the otherside
Bosch universal Sensor

Sensor to Truck
Grey to White sensor paper says sensor sender to truck
White X2 to red, Brown sensor paper says heater wire X2
Black to Purple sensor paper says ground

The other side has purple, light white or grey, light borwn and red that i used to compare it to on the truck harness.

The other side rear has different colors and could only use the purple and white for comparison. I had the check engine light reset and now it is still giving me the bank 1 sensor 2, bank 2 sensor 2 heater circuit error. I was wondering if anyone can tell me if this is hooked up correctly or might the other sensor be bad. I read they are all on the same circuit but do not know if this is true.

Any help is greatly appreciated. If anyone knows a book that will have this diagram in it with what wires actually do what i will gladly order one. Local hardware store does not have one and i dont want to waste the money if it will not tell me what wire on the truck harness does what.