[WordPress] 外掛分享: track-incoming-referrer

首頁外掛目錄 › track-incoming-referrer
10+
安裝啟用
★★★★★
5/5 分(1 則評價)
3355 天前
最後更新
問題解決
WordPress 2.5+ v1.0.0 上架:2017-01-09

內容簡介

非技術摘要:追蹤來源並將其寫入與識別碼“referrer”相同的任何隱藏表單字段(例如在Contact Form 7中創建)。此外,如果WordPress網站從HTTP重定向到HTTPS,該外掛還會覆蓋重定向以將來源添加到https URL中。

技術細節:該外掛在每個頁面的HEAD中運行客戶端JavaScript,並且如果沒有帶有名稱為“referrer”的會話Cookie,它會將名為“referrer”的會話Cookie 寫入,其值為document.referrer,如果為空,則為window.location.href的URL編碼值。還有另一個客戶端JavaScript在每個頁面之前在任何帶有ID“referrer”的輸入中寫入“referrer” cookie的值,如果存在。

與Contact Form 7整合時,添加一個隱藏輸入字段,如下所示:

[hidden referrer id:referrer]

然後在郵件Message Body中添加:

Referrer: [referrer]

如果只是將其與HTML集成,只需將其添加到任何表單中:

<input type="hidden" id="referrer" name="referrer" />

外掛標籤

開發者團隊

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

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「track-incoming-referrer」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Non-technical summary: Track incoming referrer and write it to any hidden form field with the identifier “referrer” (this can be created in Contact Form 7, for example; see below). Also if the WordPress site redirects from HTTP to HTTPS, this plugin also overrides the redirect to add the referrer to the https URL.
Technical details: This plugin runs client-side JavaScript in every page in HEAD and if there isn’t a session cookie with the name “referrer”, then it writes a session cookie with the name “referrer” and the value of either document.referrer, or if that’s empty, the URL-encoded value of window.location.href. There is another client-side JavaScript in every page before which writes the value of the “referrer” cookie to any INPUT with the ID “referrer”, if it exists.
When integrating with Contact Form 7, add a hidden input field such as the following:
[hidden referrer id:referrer]

And then add to the Mail’s Message Body:
Referrer: [referrer]

If you’re just integrating this with HTML, just add this to any form:

延伸相關外掛

文章
Filter
Mastodon