維度和量度是報表的重要元件。events
變數負責收集網站上許多量度的資料。事件通常會增加報表中的量度。
在實作事件之前,請務必在「報表套裝設定」的「成功事件」底下建立和設定事件。如果您打算在連結追蹤點擊中使用自訂事件,請確定 linkTrackVars
和 linkTrackEvents
設定正確。
自訂事件會為 Adobe Analytics 進行對應,在下列 XDM 欄位底下:
_experience.analytics.event1to100.event1
- _experience.analytics.event1to100.event100
。_experience.analytics.event101to200.event100
- _experience.analytics.event101to200.event200
。_experience.analytics.event901to1000.event901
- _experience.analytics.event901to1000.event1000
。 eventx.value
是用來指定要增加的數量。 eventx.id
是用來序列化。commerce.purchases.value
。productListItems[].quantity
欄位的總和。productListItems[].priceTotal
欄位的總和。commerce.productListViews.value
。commerce.productListOpens.value
。commerce.productListAdds.value
。commerce.productListRemovals.value
。commerce.productListViews.value
。commerce.checkouts.value
。如果在 productListItems
下設定事件 (例如 productListItems._experience.analytics.event1.value
),並且該事件尚未在此欄位中,則該事件會自動新增到此欄位中。
您可以在設定 Analytics 擴充功能 (全域變數) 時設定事件,或依據規則進行設定。
您可以使用幾個功能:
event1
在下拉式清單下,並包括 10
在此欄位中增量 event1
10。s.events
變數是字串,其中包含您要納入點擊中的逗號分隔事件清單。此變數沒有位元組限制,因此不會截斷。有效值包括:
event1
- event1000
:自訂事件,視需要設定。請將每個事件的使用方式記錄在貴組織的解決方案設計文件中。可用事件的數目取決於貴組織的 Analytics 合約。簽訂非舊式合約的組織大多可以使用 1000 個自訂事件。如果您不確定有多少個自訂事件可供使用,請連絡您的Adobe帳戶團隊。purchase
:將訂單量度增加 1,並使用在 products
變數中設定的值來計算件數和收入。如需詳細資訊,請參閱購買事件。prodView
:增加產品檢視量度。scOpen
:增加購物車量度。scAdd
:增加購物車新增量度。scRemove
:增加購物車移除量度。scView
:增加購物車檢視量度。scCheckout
:增加結帳量度。此變數會區分大小寫。請避免事件值的大小寫拼寫錯誤,確保資料彙集的準確性。
// Set the events variable to a single value
s.events = "event1";
// Set the events variable to multiple values
s.events = "event1,event13,purchase";
您可以視需要多次計算自訂事件。將整數指派給字串內的所需事件。依預設,在報表套裝設定中建立的事件是計數器事件。
// Count event1 ten times
s.events = "event1=10";
// Count event1 twice and event2 once
s.events = "event1=2,event2";
計數器事件不支援貨幣或小數值。請使用貨幣事件來報告貨幣,或使用數值事件來報告小數值。
您可以變更自訂事件,使用貨幣來取代整數。如果報表套裝貨幣與 currencyCode
變數不符,貨幣事件會自動轉換為報表套裝的貨幣。這些事件有助於計算運費、折扣或退款。如果您想要將事件歸因限制為僅限該產品,可在 products
變數中設定貨幣事件。
在實作貨幣事件之前,請務必在「報表套裝設定」的「成功事件」底下,將所需的事件設為「貨幣」。
// Send $9.99 USD in event1 using the events variable. Make sure the event type for event1 is Currency in Report suite settings
s.currencyCode = "USD";
s.events = "event1=9.99";
// Send $9.99 USD in event1 using the products variable. Make sure the event type for event1 is Currency in Report suite settings
s.currencyCode = "USD";
s.events = "event1";
s.products = "Example category;Example product;1;0;event1=9.99";
如果您同時在 events
和 products
變數中設定貨幣值,系統會使用 events
中的貨幣值。請避免同時在 events
和 products
變數中設定貨幣值。
您可以變更自訂事件,改為接受小數值而非整數。數值事件的行為與貨幣事件類似,但它們不使用貨幣轉換。如果您想要將事件歸因限制為僅限該產品,可在 products
變數中設定數值事件。
在實作數值事件之前,請務必在「報表套裝設定」的「成功事件」底下,將所需的事件設為「數值」。
// Send 4.5 in event1 using the events variable. Make sure the event type for event1 is Numeric in Report suite settings
s.events = "event1=4.5";
// Send 4.5 in event1 using the products variable. Make sure the event type for event1 is Numeric in Report suite settings
s.events = "event1";
s.products = "Example category;Example product;1;0;event1=4.5";
如果您同時在 events
和 products
變數中設定數值,系統會使用 events
中的數值。請避免同時在 events
和 products
變數中設定數值。