I'm in the process of optimizing the speed of our store to improve conversions and SEO.
Since a big chunk of the loading and rendering time comes from all the scripts that gets loaded, I was thinking to move most of the scripts to Google Tag Manager to get more control over load order and reduce the number of queries.
I haven't started with digging into the scripts with dynamic liquid code yet, but I guess I'll figure it out eventually.
Has anyone else done something similar? Anything I should be aware of? Do you think the speed will improve?
Do NOT do this for non-marketing related "tags" if this is a store in production or a store you will be handing over.
If this is for most marketing scripts, sure that's the point of GTM
#1 don't muddle analytics with other theme functionality
#2 adblockers exist
#3 optimization is easier the less domains involved
on and on
This can lead to invisible undetectable problems where for you and tests everything seems fine but there's a hole in the ship somewhere losing air.
to get more control over load order and reduce the number of queries
... I haven't started with digging into the scripts with dynamic liquid code yet, but I guess I'll figure it out eventually.
If this idea is because your not experienced with shopify themes yet take that as a clue that this is a risky experiment for a business.
Learning themes and Learning optimization are two different things and there are tons of post on different methods people are using to optimize shopify themes, schedule accordingly.
Do you think the speed will improve?
It could , are you prepared to invest excessive time and money to support a hack?