2
Googleアナリティクスで404につながるパスをトラッキングしたいと考えています。Googleアナリティクス - トラック404リファラー
マイGoogleアナリティクスJS:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-11111111-1']);
_gaq.push(['_setDomainName', 'example.com']);
_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>
リファラJS:でも、何を待って4日後の
<script type="text/javascript">
try{
var pageTracker = _gat._getTracker("UA-11111111-1");
pageTracker._trackPageview("/404.html?page=" + document.location.pathname + document.location.search + "&from=" + document.referrer);
} catch(err) {}
</script>
はAnalyticsの概要に表示されます。 (自分で404エラーが発生しました) コードに何か問題はありますか?
私のイベントでは、「パス名なし」の「404」しか表示されません。 ** location.pathname **の代わりに** document.location.pathname **に設定する必要がありますか?これは何が原因ですか?ありがとう。 – Tom