Book the earlier ticket on a fare that allows same day change (plus fares?). Once you’re in the air and have a clearer view on arrival time, make required changes using the onboard WiFi.
also, at SFO ask for your bag to be checked through to GLA. They’ll likely say no, but if you get lucky it should make the experience much more pleasant.