What I do is measure the distance between the frame and the axle (ignore the bumpstop as if it didn't exist). That is worst case compression travel.
Subtract that number from the length between the shock mounts. That is compressed shock length. Shop by that number.
If you get a shock with a longer compressed length you risk bottoming the shock out. You can go slightly longer if you are sure you still have enough fudge factor with the total amount of squish possible on the bumpstop. Rubber has a lot of available squish, on a stock rubber it is possible to squish all the way to the cup. For segmented poly, where all poly goes solid under the segmentations leaves me with all the segments squishing flat.