Should we split the script tags in Optimizely code? Using document.write via tag manager Tealium
We are implementing Optimizely across a site with Tealium (a tag manager), following the synchronous loading guide.
A development agency want to implement the tracking code in the following way:
document.write('<scr' + 'ipt src="//cdn.optimizely.com/js/123456789.js"></scr' + 'ipt>');
(Note how the script tags are split.)
Can you see any issues for Optimizely experiments when doing it this way?
Does it pose a risk to Optimizely working correctly?
A developer asserts that including un-split script tags could cause problems in some browsers. He believes there is a risk of the code causing other HTML on the page not to work.
A popular question about splitting script tags on StackOverflow dates back to 2008 — a time when Amazon and Yahoo did this (they don't anymore). Is this approach out of date?