With all advice you have to take it with a grain of salt. It's good guidance but also evaluate each unique situation.
Sacramento - Central to CA but not a destination for those out of state. Tahoe is close, Napa not too far, and rafting on the American River is fun but what will pull people from everywhere to visit?
Phoenix - Very big area so you'll need to look at what's nearby. Scottsdale has the resorts and nightlife (hotels do a lot of research so you can see where they are building to understand where vacationers visit). Spring Training baseball is a high occupancy season. Sedona 1.5 hours, Flagstaff 2 hours, Grand Canyon and other parks a little further. Many tech companies in surrounding suburbs. Popular with snowbirds. Super hot summers when occupancy will be really low. However, many will say they can make enough money in the 6 months that are super busy where the down months don't impact profitability.
Generally, AZ is more favorable than CA for short term rentals. Many other factors could make AZ more profitable like property taxes, insurance, and other state specific laws. If you want to invest in CA, maybe also look at other areas that might be more attractive for STRs.