優先爭取特定點擊、觀看或轉換
設定 API,優先處理特定來源或觸發條件。
為事件層級或可匯總報表設定特定點擊或觀看的優先順序
您可以使用來源端的優先順序變更 Attribution Reporting API 的預設行為。根據預設,歸因模式為最終接觸,代表轉換會歸給最近一次相符的來源事件。在事件層級和可匯總報表中,您都可以調整這項行為。
如要變更預設優先順序,請在來源登錄標頭中加入 priority
鍵。
為你想優先處理的來源設定較高的優先順序。值越大代表優先順序越高;舉例來說,priority
為 2 的來源事件優先於 priority
為 1 的來源。
系統只會傳送與最高優先順序來源事件相符的報表。
範例程式碼
變更歸因方式,選取較不近期的來源 (最初點擊):
const currentTimestamp = Date.now();
const priority = -currentTimestamp;
res.set(
"Attribution-Reporting-Register-Source",
JSON.stringify({
// … all usual fields for that header
priority: `${priority}`
})
);
事件層級報表優先顯示特定轉換
有別於來源端優先順序,設定觸發端優先順序僅適用於事件層級報表。
假設某位使用者點擊廣告後完成轉換了四次:他前往廣告客戶的網站首頁,然後造訪產品網頁,訂閱電子報,最後才完成購買。
不過,由於點擊有三份報表的限制,根據預設,系統會捨棄註冊 (第三次轉換) 後的所有後續報表,包括購買報表。
您可以設定 API,接收您認為更重要的轉換報表。例如購買報表
方法是將 priority
鍵加入觸發事件登錄標頭,並為您要優先處理的轉換設定較高的優先順序。
特定來源事件觸發歸因時,如果這個來源的歸因數量達到上限 (點擊三次,針對觀看各一次),瀏覽器就會:
如未設定優先順序,瀏覽器會改回使用預設行為:點擊第三次轉換之後發生的轉換,或是觀看的第一次轉換後,系統會捨棄這些轉換。
參閱程式碼範例:優先處理結帳類型的轉換
後續步驟
如要瞭解如何設定來源和觸發條件,請參閱:
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2022-12-15 (世界標準時間)。
[null,null,["上次更新時間:2022-12-15 (世界標準時間)。"],[[["The Attribution Reporting API defaults to last-touch attribution, but you can prioritize specific sources or triggers to change this behavior."],["Source-side priorities allow you to prioritize specific clicks or views across both event-level and aggregatable reports by setting higher priority values in the source registration header."],["For event-level reports, trigger-side priorities enable you to prioritize specific conversions, ensuring reports for important events are received even if the attribution limit is reached."],["The browser compares report priorities and replaces lower-priority reports with higher-priority ones to manage the report limits for a given source."],["Setting priorities for sources and triggers allows advertisers to receive the most relevant attribution data within the API's constraints."]]],["The Attribution Reporting API can be configured to prioritize specific sources or conversions. This is done by adding a `priority` key to the source or trigger registration header. Higher `priority` values take precedence. For sources, this determines which source event is attributed to a conversion, overriding the default last-touch model. For triggers, it determines which conversions are reported when the maximum number of reports is reached, allowing for prioritizing important conversions, like purchases, over less significant ones.\n"]]