Implementing using Adobe DTM[ Edited ]
March - last edited March
Recently I got invitation to use Google's new tool Google Optimize. I have been trying to add it using Adobe's DTM using Google Universal Analytics tool and adding the container tag using "Customize Page Code" option. The Optimize libraries are being called, however I am seeing following error in the page console itself:
"Refused to execute script from 'https://optimize.google.com/optimize/inject/inject.js........ because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled."
Just wondering anyone out there has been able to successfully inject Google Optimize using Adobe's DTM?
Implementing using Adobe DTM
You should be able to use the Optimize editor (which is where you get the error) on any website (even one that is not yours) even if that site is not using Google Optimize. Of course you will not be able to run experiments on that site, but you should still be able to see how the Optimize editor works on it.
So the problem that you report is unrelated with Adobe DTM, and looks more likely to be related with the network (proxy ?) or perhaps a chrome extension.
I have successfully been able to edit the page that you are trying to edit myself, using the same OS and browser with you, without any problem.
So can you please try the following to troubleshoot:
- Make an experiment and try to edit another page like for example: https://www.google.com/analytics/optimize/ to see if that works (you can delete that experiment later).
- See if the problem still happens if you use a different network, or a different computer (could you ask someone else to use Optimize and try to edit your page?)
- If you are familiar with Chrome dev tools, open the network tab, find the "inject.js" request and have a look at the Response tab.
The reason that you are receiving the message ("Refused to execute script"), is probably because you get back an error message instead of that script (which is why it can't be executed). Maybe this will help us understand what is going on.
Would really appreciate if you let us know more about your findings.
Re: Implementing using Adobe DTM
Hi could that be related to blocking of third party cookies by your browser settings?
An option is to add an exception that allows third party cookies for optimize.google.com and www.google-analytics.com, see below.
Just to note that third party cookies are required just for authentication purposes (since the Optimize editor needs to store data into your Google Optimize account).
This is not allowed when you block third-party cookies (since the Optimize editor is loaded inside the edited page), but adding an exception for optimize.google.com solves the problem and will still block all other third-party cookies (for ads etc).