I’m just sitting here wondering about a thing: what is the more effective/efficient way to add scripts to one’s site: using Google Tag Manager or putting straight into the code injection in Ghost admin?
To be clear, I’m wondering about this in terms of performance, not what might be the most convenient way for a user. Ghost caching having any benefits?
My usecase is a handful of scripts: analytics, some affiliate things and such.
I use tag manager but that’s just because I imagined it’s a smart thing to do, in reality, I don’t have a clue. Someone who knows these things better?
I’ve added GA in my theme instead of as an injection. This because of, as I understand it, the theme template files are loaded first - then injections. I might be wrong, but it’s working fine for me.
Performance-wise, if you’re using GTM for just analytics, or just one bit of code, it’s actually less efficient in my experience. But if you’re using quite a few bits of code, it’s nice to be able to control everything from one dashboard and also being able to add or remove code directly from that same dashboard - on the fly!
Alright thanks for sharing your views. Actually, I’m still wondering about my very question: is there any difference between using GTM or simply code injection performance-wise, that is in terms of speed and such. What do I know, maybe there’s no difference at all? Thanks anyway -