Carthook not support the direct script tag on global code Here is the solution, You just need to change optimize code instead of 1234567
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://www.googleoptimize.com/optimize.js?id=OPT-1234567';    
document.getElementsByTagName('head')[0].appendChild(script);
 

Shopify Experts · OneOnic

Ready to Grow Your Shopify Store?

Our Shopify experts at OneOnic have helped hundreds of brands launch, optimise, and scale. Let’s talk about your project.