我知道有這樣的事情相當數量,但我無法得到我的工作。我只擔心跨域而不是子域。跨域谷歌分析
我有2個網站,www.siteA.com和www.siteB.org例如。
SiteA有鏈接到我的註冊頁面SiteB。
在站點A我有以下腳本(在我的layoutpage /主):
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '##AnalyticsIDA##']);
_gaq.push(['_setAllowLinker', true]);
_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>
在網站B我有以下腳本(在我的layoutpage /主):
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '##AnalyticsIDA##']);
_gaq.push(['_setAllowLinker', true]);
_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>
我有鏈接SiteA
<a href="www.siteB.org" onclick="_gaq.push(['_link', 'www.siteB.org']); return false;">testing</a>
這需要我www.siteB.org所有正確的參數(同我站點A cookie值),但網站B的餅乾有不同的價值觀,以站點A。
編輯
Futhermore,我也使用_gaq.push(['_setDomainName', 'siteA.com']);
和_gaq.push(['_setDomainName', 'siteB.com']);
嘗試,但我仍然得到新的餅乾上站點B
嗨@mike,我試過這個,但無濟於事。我也剛剛採取了網址參數,並將其附加到我的siteB網址,仍然我得到新的餅乾。 – Bob
也許是一個愚蠢的問題,但是您在測試之前是否在兩個網站上清除了您的Cookie?你可以發佈'__utmz'餅乾的內容嗎?也許__utm.gif請求的參數... – mike
我確實清除了cookie。我將在明天回覆內容。 – Bob