To be certain, you should:
1. Consult your vehicle's repair manual: This is the most reliable source for the precise location in *your* specific Ranger.
2. Look up diagrams online: Use your vehicle's year, make, model, and engine details in a parts website search (e.g., AutoZone, Advance Auto Parts) to find diagrams showing the speed sensor location.
Be prepared to get dirty; accessing the differential requires getting underneath the truck.