The GPS/Compass module will have 2 wires. You will want to plug them into the port labeled "GPS" and the one on the side under it. NOT the I2C port like on older apm models. Then you will want to remove a small jumper wire that will be on the connectors next to those ports. This will tell the apm to read input from the compass on the GPS.
There is no programming required other than calibration in mission planner.
Glad I could help!