2012-02-06 46 views
3

我正在嘗試在Google Analytics上測試6個自定義變量。Google Analytics上的多個自定義變量

當我進入高級細分時,我只能看到來自最後一個變量的訪問。 如何讓剩餘的自定義變量起作用?

我不知道如果我不得不把_trackPageview放在一個以上,所以我嘗試把它放在我的第五個頻道之後,它仍然不起作用。

這裏是我的代碼:

<script type="text/javascript"> 

var _gaq = _gaq || []; 

_gaq.push(['_setAccount', 'UA-XXXXXXXX-X']); 
_gaq.push(["_setCustomVar", 1, "Channel", "One", 3]); 
_gaq.push(["_setCustomVar", 1, "Channel", "Three", 1]); 
_gaq.push(["_setCustomVar", 1, "Channel", "Four", 1]); 
_gaq.push(["_setCustomVar", 1, "Channel", "Five", 2]); 
_gaq.push(['_trackPageview']); 
_gaq.push(["_setCustomVar", 1, "Channel", "Six", 2]); 
_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> 

有人可以幫助我?

如何獲得多個自定義變量的工作?

謝謝!

回答

8

每個請求有5個自定義變量的限制。

重複鍵名稱不能跨插槽使用。 Channel變量全部位於插槽1中。

具有鍵名「通道」的自定義變量被最後一個自定義變量覆蓋。爲了說明這一點,考慮一下:

_gaq.push(["_setCustomVar", 1, "Visitor-Type", "Member", 1]); 
_gaq.push(["_setCustomVar", 1, "Visitor-Type", "Non-Member", 1]); 

,因爲它覆蓋以前的自定義變量的Visitor-Type自定義變量將被記錄爲Non-member。它不會在分析中記錄兩者的價值。

你可以代替試試這個:

_gaq.push(["_setCustomVar", 1, "Channel", "One", 3]); 
_gaq.push(["_setCustomVar", 2, "Channel", "Two", 1]); 
_gaq.push(["_setCustomVar", 3, "Channel", "Three", 1]); 
_gaq.push(["_setCustomVar", 4, "Channel", "Four", 1]); 
_gaq.push(["_setCustomVar", 5, "Channel", "Five", 2]); 

Custom Variable Usage Guidelines

或者,使用Event Tracking而不是部分或全部這些自定義變量。

相關問題