[WordPress] 外掛分享: Cookieless Privacy-Focused Google Analytics

首頁外掛目錄 › Cookieless Privacy-Focused Google Analytics
200+
安裝啟用
★★★★★
5/5 分(2 則評價)
2112 天前
最後更新
問題解決
WordPress 4.4+ PHP 7.0+ v1.0.1 上架:2020-06-04

內容簡介

Cookieless Privacy-Focused Google Analytics 將 GA 追蹤腳本添加到您的網站,同時以這樣的方式配置它,使最終用戶的瀏覽器中不存儲任何 cookie 或其他數據。使用此外掛後,無需要求用戶同意即可符合 GDPR 和其他歐盟法律法規。

能夠在不需要顯示 cookie 同意對話框的情況下使用 Google Analytics 是該插件的主要動機。

當然,該插件也啟用了通過 anonymizeIp 匿名化 IP 地址功能。

運作原理

Google Analytics 需要用戶端 ID,該 ID 是標識用戶瀏覽器並在頁面訪問之間持續存在的唯一字符串。如果沒有該插件,當第一次訪問網站時,Google Analytics 腳本會生成用戶端 ID 並存儲在 cookie 中。

該插件基本上會做兩件事:

通過將 storage 設置為 none 來禁用所有 Google Analytics cookie
在每次頁面加載時即時生成替代用戶端 ID

用戶端 ID 生成

儘管 Google Analytics 即使沒有用戶端 ID,也能正常運行,但其許多功能需要不會在頁面訪問或訪問之間更改的 ID。該插件在加載頁面時使用 JavaScript 即時生成用戶端 ID。

生成的用戶端 ID 不包含任何可識別個人的信息。實現方式如下:

對構成用戶端 ID 的部分進行哈希處理。
每隔幾天(可配置)更換新的 ID。

以下部分用於構建用戶端 ID(然後進行哈希處理後成為字符串):

Web 服務器看到的用戶端 IP 地址
安裝了該插件的網站域名
瀏覽器用戶代理
瀏覽器語言
有效期(每 n 天更改一次以強制生成新的用戶端 ID,防止長期跟踪)

使用方法

安裝該插件並添加 Google Analytics 追蹤代碼(UA-xxxxxx-y)。就是這樣。

可配置設置

Google Analytics 追蹤代碼
用戶端 ID 的有效期,以天為單位(預設:4)
是否為 WordPress 管理員啟用分析腳本(具有 manage_options 能力的用戶)?(預設:否)

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Cookieless Privacy-Focused Google Analytics」→ 直接安裝(推薦)

原文外掛簡介

Cookieless Privacy-Focused Google Analytics adds the GA tracking script to your site while configuring it in such a way that no cookies or other data are stored in the end user’s browser. With this plugin, it should not be necessary to ask for user consent in order to be compliant with GDPR and other EU legislation.
Being able to use Google Analytics without having to display a cookie consent dialog was the primary motivation behind the plugin.
IP address anonymization via anonymizeIp is enabled by the plugin, too, of course.
How It Works
Google Analytics requires a client ID, a unique string that identifies the user’s browser and persists between page hits. Without this plugin, the client ID is generated by the Google Analytics script when a site is first visited and stored in a cookie.
This plugin basically does two things:

Disable all Google Analytics cookies by setting storage to none
Generate an alternative client ID on the fly whenever a page is loaded

Client ID Generation
While Google Analytics works even without a client ID, many of its features require an ID that does not change between page hits or visits. This plugin generates the client ID on the fly in JavaScript while a page is loaded.
The generated client ID does not contain any personally identifiable information. This is achieved by:

Hashing the components that make up the client ID.
Switching to a new ID every few days (configurable).

The following components are used to build the client ID (the string that is then hashed):

Client IP address as seen by the webserver
Domain of the website where the plugin is installed
Browser user agent
Browser language
Validity period (a number that changes every n days to force a new client ID and prevent long-term tracking)

Usage
Install the plugin and add your Google Analytics tracking code (UA-xxxxxx-y). That’s it.
Configurable Settings

Google Analytics tracking code
Validity period of the client ID in days (default: 4)
Enable the analytics script for WordPress admins (users that have the capability manage_options)? (default: no)

延伸相關外掛

文章
Filter
Apply Filters
Mastodon