If you’re not using the phone for the ride, Strava etc, turn off GPS, WiFi and also turn off Mobile Data (assuming you don’t need FB updates as you ride. You will need to turn it on to post those selfies though 😉 ).
My phone can last a long ride with some to spare if I turn all that off. Will be dead in a few hours if they’re on.
Also, where you ride affects the battery. If you ride somewhere with good strong mobile coverage then it will use less power. If the signal is poor or worse there is no signal in many places then the phone will boost its power trying to get a signal, and the battery will drain faster.
Dedicated GPS if you want all day tracking and still save your phone. Or two phones, one for tracking, one for calls and emergencies. Or an old Symbian pre-touch Nokia with GPS and something like Endomondo, Sports Tracker or ViewRanger to track. Battery in that will last for days, and certainly go through a whole day of riding with GPS on. But still, dedicated GPS would be easiest option.