#google-analytics
#google-analytics
Вопрос:
Я попытался внедрить эксперименты Google Analytics на одну из своих страниц. Я добавил следующий код:
<!-- Google Analytics Content Experiment code -->
<script>function utmx_section(){}function utmx(){}(function(){var
k='122644017-3',d=document,l=d.location,c=d.cookie;
if(l.search.indexOf('utm_expid=' k)>0)return; function f(n){if(c){var
i=c.indexOf(n '=');if(i>-1){var j=c. indexOf(';',i);return
escape(c.substring(i n.length 1,j<0?c. length:j))}}}var
x=f('__utmx'),xx=f('__utmxx'),h=l.hash;d.write( '<sc' 'ript src="' 'http'
(l.protocol=='https:'?'s://ssl': '://www') '.google-
analytics.com/ga_exp.js?' 'utmxkey=' k 'amp;utmx=' (x?x:'') 'amp;utmxx=' (xx?
xx:'') 'amp;utmxtime=' new Date(). valueOf()
(h?'amp;utmxhash=' escape(h.substr(1)):'') '" type="text/javascript"
charset="utf-8"></sc' 'ript>')})(); </script><script>utmx('url','A/B');
</script>
<!-- End of Google Analytics Content Experiment code -->
в голову, но моя консоль выдает следующий вывод:
A Parser-blocking, cross-origin script, https://ssl.google-analytics.com/ga_exp.js?utmxkey=122644017-3amp;utmx=amp;utmxx=amp;utmxtime=1475762834841, is invoked via document.write. This may be blocked by the browser if the device has poor network connectivity.
Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.
Я пытался найти эту ошибку в Google, даже искал это место перед публикацией, но я понятия не имею, почему я получаю это. Есть ли здесь кто-нибудь, кто мог бы указать мне правильное направление для решения этой проблемы?
Комментарии:
1. Связанная информация (однако решения нет): developers.google.com/web/updates/2016/08 /…
2. Вы решили это?