I would like to add Google Optimize snippet on my Magento site. I added the Optimize snippet to the site via Admin -> System -> Configuration -> General -> Design -> HTML Head. However, the snippet does not register with Google. Screenshot below. Code snippet below. How can we fix this issue?

enter image description here

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXXX-1', 'auto'); ga('require', 'GTM-XXXXX'); ga('send', 'pageview');
  • This is a legitimate question, please make available to the community. Thank you.
    – Elvis
    Apr 5, 2017 at 14:31
  • I can see why this was closed, but I agree with you in that it is something that will be searched for more and more. I've answered the question here with a module that caters for your request - magento.stackexchange.com/questions/167407/…
    – McNab
    Aug 9, 2017 at 11:14


Browse other questions tagged or ask your own question.