追蹤程式碼:Urchin 伺服器

您在使用 Google Analytics (分析) 和 Urchin 軟體進行網站追蹤時,使用這個配置伺服器設定的方法。

GATC Urchin 伺服器方法

方法說明

_getLocalGifPath()

_getLocalGifPath()

取得 Urchin GIF 檔案的本機路徑。詳情請參閱《_setLocalGifPath()》。

非同步程式碼片段 (建議)

_gaq.push(function() {
  var pageTracker = _gat._getTrackerByName(); // Gets the default tracker.
  var localGifPath = pageTracker._getLocalGifPath();
});

return

    String 本機伺服器上的 GIF 路徑。

_getServiceMode()

_getServiceMode()

傳回伺服器作業模式。本機模式 (將資料傳送至 _setLocalGifPath() 設定的本機伺服器) 可能為 0、遠端模式 (將資料傳送至 Google Analytics (分析) 後端伺服器) 為 1,本機和遠端模式的值可能為 2。

非同步程式碼片段 (建議)

_gaq.push(function() {
 var pageTracker = _gat._getTrackerByName(); // Gets the default tracker.
 var serviceMode = pageTracker._getServiceMode();
});

return

Number 伺服器作業模式。


_setLocalGifPath()

_setLocalGifPath(newLocalGifPath)

設定 Urchin GIF 檔案的本機路徑。如果您在本機伺服器上執行 Urchin 追蹤軟體,請使用這個方法。_setLocalServerMode()_setLocalRemoteServerMode() 方法會使用您指定的路徑,以確定本機伺服器本身的路徑。

非同步程式碼片段 (建議)

_gaq.push(['_setLocalGifPath', 'http://mysite.com']);

參數

String   newLocalGifPath 本機伺服器上的 GIF 檔案路徑。


_setLocalRemoteServerMode()

_setLocalRemoteServerMode()

請叫用這個方法,將追蹤資料同時傳送至本機伺服器和 Google Analytics (分析) 後端伺服器。如果您在本機伺服器上執行 Urchin 追蹤軟體,而且想要在本機和 Google Analytics (分析) 伺服器上追蹤資料,就可以使用這個方法。在這種情況下,本機伺服器的路徑會由 _setLocalGifPath() 設定。

非同步程式碼片段 (建議)

_gaq.push(['_setLocalRemoteServerMode']);


_ServerLocalMode()

_setLocalServerMode()

請叫用這個方法,將追蹤資料傳送至本機伺服器。如果您在本機伺服器上執行 Urchin 追蹤軟體,並希望將所有追蹤資料傳送至您的伺服器,請使用這個方法。在這種情況下,本機伺服器的路徑會由 _setLocalGifPath() 設定。

非同步程式碼片段 (建議)

 _gaq.push(['_setLocalServerMode']);


_setRemoteServerMode()

_setRemoteServerMode()

根據預設,安裝 Google Analytics (分析) 後,系統會將追蹤資料傳送至 Google Analytics (分析) 伺服器。如果您已為網站安裝 Urchin 軟體,而且只想將特定追蹤資料傳送至 Google Analytics (分析) 伺服器,請使用這個方法。

非同步程式碼片段 (建議)

_gaq.push(['_setRemoteServerMode']);