So, is it possible to purchase the Tarjeta Dorada online before arriving into Spain?.
If not, the discount available with the Tarjeta may not be as much as the discount available when you book train travel in advance.
As an example, I'm arriving in Madrid late August and will catch the train up to Pamplona, if I pre-book that train travel a few months in advance I'll get significant discounts. If I wait until I arrive into Madrid, then purchase the Tarjeta, I'll get the 25% discount, but the fares will be significantly higher, and I'd run the risk of either not being able to arrange the Tarjeta or the train being booked out. (unlikely).
If, like a lot of walkers, there's only going to be one or two trips by train, e.g. up from Madrid, back from Santiago, then it might not be worth it. If you're planning on a longer stay in Spain then it's a no-brainer. It'd be good to get it in advance on-line though, that might enable both discounts to apply, early booking and the Tarjeta discount.