Google Analytics 改進 Tracking code 發送方式

Google Analytics 改進 Tracking code 發送資料的方式, 簡單說, 就是下述兩點:

  • 小於 2048 bytes 的走 HTTP GET
  • 大於 2048 bytes 的走 HTTP POST

相關新聞

  • 原文: Leading The Industry with Tracking Code Improvements (下述摘錄自此文)
    • Traditionally, client-side tracking code beacons have been sent via HTTP GET requests, which are limited to 2048 bytes by some browsers and proxies. Requests sent to Analytics that exceeded this limit were dropped, and the data never reached Google Analytics. Starting with this release, requests longer than 2048 bytes will be sent via HTTP POST, which has no such limit. The tracking code will now support beacons up to 8192 bytes!
    • This feature requires no user configuration and has been pushed in the latest version of the JavaScript tracking code. With this new capability we hope to bring you even more innovative features in the coming months.
  • 中文簡體版: Google Analytics 改進跟蹤代碼發送請求方式引領統計行業發展 - 上述文章的完整翻譯

新聞內容重點摘錄

  • 傳統的 Client 端 與 Tracking code 統計數據通過 HTTP GET 請求發送, 部分 Browser 與 Proxy 對該方式(HTTP GET)有 2048 bytes 的長度限制.
  • 發往 Analytics 的超出該限制的請求會被丟棄, 這些統計數據將無法被 Google Analytics 收到.
  • 新版 Tracking code 中, 長於 2048 bytes 的請求將通過 HTTP POST 發送, 該方式無此類限制.
  • Tracking 現在支持發送的統計數據長達 8192 bytes.
  • Tracking code 程式不用做更新, Google Analytics 會自動更新.
  • 簡單講, 現在新版 Google analytics tracking code, 若 request 長度超過 2048 bytes, 會改用 HTTP POST 發送, 目前最長限制 8192 bytes.
  • 因此有些過長的資料漏掉, 是正常的.

HTTP GET 於瀏覽器的長度限制

不過, 瀏覽器對 HTTP GET 的長度, 似乎比規範中的還要長很多, 會漏掉而沒紀錄的訊息, MIS 應該不會想看到. XD

下面把瀏覽器現在實作的 Maximum URL 長度 (HTTP GET 長度限制) 的文章做些整理:

相關文章

作者: Tsung

對新奇的事物都很有興趣, 喜歡簡單的東西, 過簡單的生活.

發表迴響

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料