Once started I believe you can turn off data on the phone and Strava will still track. But yes, phone in the pocket is risking a smashed screen in a crash (though I’ve got lazy and do it, even though I don’t Strava on the phone anyway. Just it’s easy to get the phone out for photos or checking stuff up on ViewRanger). Phone will work in a backpack though if you ride with one.
Phones running a GPS tracker are also consuming battery which may leave you with a dead phone which isn’t useful in an emergency.
So anyway, as said, any GPS tracker device basically. Upload the result GPX / FIT file etc to Strava, or in some cases to the site for the device if Strava will sync to it. e.g. Garmin devices, upload to Garmin and you can have Strava sync with it. There’s also a Garmin app for the phone that will sync with Garmin devices that use Bluetooth or WiFi. But they aren’t the cheapest options.