我已在我的域的子域中添加了此代码以跟踪某些页面,但我不知道为什么它不起作用。
我想提一下,被跟踪的页面在域上,而不是在子域上。
<script type="text/javascript">
window.onload = function () {
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-15318659-1']);
_gaq.push(['_setDomainName', 'savoyhotel.ro']);
var hdStep = parseInt(document.getElementById('hdStep').value);
switch (hdStep) {
case 1: { _gaq.push(['_trackPageview', '/alege-data']); if(document.location.hash == '#test-lucian-20130401') { alert('alege-data') } break; }
case 2: { _gaq.push(['_trackPageview', '/alege-camera']); if(document.location.hash == '#test-lucian-20130401') { alert('alege-camera') } break; }
case 3: { _gaq.push(['_trackPageview', '/date-personale']); if(document.location.hash == '#test-lucian-20130401') { alert('date-personale') } break; }
case 4: { _gaq.push(['_trackPageview', '/finalizare-fara-garantare']); if(document.location.hash == '#test-lucian-20130401') { alert('finalizare-fara-garantare') } break; }
case 5: { _gaq.push(['_trackPageview', '/finalizare']); if(document.location.hash == '#test-lucian-20130401') { alert('finalizare') } break; }
}
(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>
有人知道吗?