There is a spec for pinion depth.
There should be a number on the pinion gear face. + or - X number.
Measure the thickness of the shims currently on the pinion gear. (I think they are between the front (larger) bearing, and the pinion gear.)
Add those numbers together.
Subtract the number on the face of the new pinion gear.
That will give you the shim thickness you want to start out. Then measure depth, and adjust as needed.