My experience with the Tarjeta Dorada has been as Nick said. On my 2019 trip to Spain I was traveling during Semana Santa, so I needed to make quite a few hotel reservations in advance (not my usual practice beyond my arrival destination). Having to buy the Alhambra ticket well in advance was a second limitation on my flexibility. Since I knew the days I was to arrive in several cities, I also knew the days I'd be taking the train to those cities, and there was no reason (pre-COVID) not to buy a promo-priced ticket ahead of time when the savings would be greater than those offered by the Tarjeta Dorada.
I checked fares carefully, comparing what I'd pay on my actual travel date for an immediate (nonrefundable) purchase to the current-day ticket price less the Tarjeta Dorada discount. In the end just one ticket fell into the category of enough extra savings to be worth tying myself down to a specific train so far in advance. I was a bit nervous about the transaction on the Renfe website because it shifted back to Spanish mid-way through (which I think was par for the course, at least back in 2019), but I had read about the online-purchase process (I think there's a TripAdvisor thread), and it worked for me. I had 3 credit cards lined up in case the first one wasn't accepted, but it was. I probably called the credit card company ahead of time to warn that a Spanish transaction would be coming through. When you do that, they often ask the amount of the transaction, so be prepared to answer that question.
Through a combination of jetlag, sleep-deprivation and misinformation from a Renfe staff person at Atocha Station, I thought it wasn't possible to buy tickets at the Tarjeta Dorada discount out of the ticket-vending machines in rail stations, but that was incorrect. There's a T.D. option on the machines--which have an English setting--that's not hard to find if you are not a walking zombie. This is critical information, because the staffed ticket counters at Atocha are reminiscent of what you'd have found in shops in the USSR back in the 1970s. I stood in line for three hours.
In the past there have been some rumblings about US credit card issues in Renfe's ticket-vending machines. I can't vouch for whether that's still an issue (or ever was, but it sounded likely). I never had a problem, but I take a lot of short trips on non-express trains, and I think it's possible lower-value purchases might go through on a US credit card when higher-value ones wouldn't, so if you have an issue you could try buying each ticket individually rather than multiple tickets as part of a single transaction. That would be fine on trains without seat reservations; I cannot guess what would happen if you tried that with AVE tickets. All I know is that the long-distance-ticket counters at Atocha Station are to be avoided at (pretty much literally) all cost--unless they have finally fixed the long-term issues there.
I bought my Tarjeta Dorada at the airport train station in Madrid. I'd assume you can do the same in Barcelona. It was very quick, and it should also be possible to buy AVE tickets there using the T.D., thereby avoiding the need to make a later purchase at Madrid-Atocha.