使用从谷歌分析产品生成的代码:(信息经过审查)
<meta name="google-site-verification" content="xxxxxxxxxxxx" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'xxxxxxxx']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type =
'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ?
'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
导致内部500错误,代码在head标签中
最佳答案
如果您的网站使用 Smarty 模板引擎,只需将此代码粘贴到模板中就会导致 500 内部服务器错误,因为模板无法正确解释代码。
将代码粘贴到
中{literal}
...
{/literal}
阻止你的问题就会得到解决!
向 Logicia.co.uk blog 大声喊叫这帮助我解决了同样的问题。
关于php - Google Analytics 导致 500 内部错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13312290/