autoCollectPropositionInteractions
autoCollectPropositionInteractions
屬性是選擇性設定,可決定Web SDK是否應自動收集主張互動。
值是決定提供者的地圖,每個提供者都有表示應如何處理自動主張互動的值。
支援的值 supported-values
依預設,自動主張互動是 一律 收集給Adobe Journey Optimizer (AJO
),以及 永遠不收集 收集給Adobe Target (TGT
)。
autoTrackPropositionInteractions
的預設值顯示如下。
{
"AJO": "always",
"TGT": "never"
}
如需每個決定提供者的支援設定值,請參閱下表。
always
interact
個事件。never
interact
個事件。decoratedElementsOnly
interact
事件,但前提是元素包含指定標籤或權杖的資料屬性。自動主張互動追蹤 logic
當您啟用自動主張互動追蹤時,Web SDK會自動收集轉譯為DOM之主張元素內的任何點按。 這包括任何由Web SDK自動轉譯為DOM的體驗,以及使用applyPropositions
命令轉譯為DOM的體驗。
資料屬性 data-attributes
您可以使用元素上的資料屬性,為互動新增特性。
data-aep-click-label
data-aep-click-token
data-aep-interact-id
範例
請參閱下列程式碼片段,以檢視使用資料屬性的範例。
<div class="row movies" data-aep-interact-id="5">
<div class="col-md-4 movie" data-aep-click-token="wlpk/z/qyDGoFGF1E47O0w">
<img src="/img/walle.jpg" class="poster" />
<h2>WALL·E</h2>
<p class="description"> In a distant, but not so unrealistic, future where mankind has abandoned earth because it has become covered with trash from products sold by the powerful multi-national Buy N Large corporation, WALL-E, a garbage collecting robot has been left to clean up the mess. </p>
<p>
<button class="btn btn-default" data-aep-click-label="view-movie-WALL·E"> View details >> </button>
</p>
</div>
<div class="col-md-4 movie" data-aep-click-token="6ZUrou9BVKIsINIAqxylzw">
<img src="/img/ratatouille.jpg" class="poster" />
<h2>Ratatouille</h2>
<p class="description"> A rat named Remy dreams of becoming a great French chef despite his family's wishes and the obvious problem of being a rat in a decidedly rodent-phobic profession. When fate places Remy in the sewers of Paris, he finds himself ideally situated beneath a restaurant made famous by his culinary hero, Auguste Gusteau. </p>
<p>
<button class="btn btn-default" data-aep-click-label="view-movie-Ratatouille"> View details >> </button>
</p>
</div>
<div class="col-md-4 movie" data-aep-click-token="QuuXntMRGnCP/AsZHf4pnQ">
<img src="/img/coco.jpg" class="poster" />
<h2>Coco</h2>
<p class="description"> Despite his family's baffling generations-old ban on music, Miguel dreams of becoming an accomplished musician like his idol, Ernesto de la Cruz. Desperate to prove his talent, Miguel finds himself in the stunning and colorful Land of the Dead following a mysterious chain of events. </p>
<p>
<button class="btn btn-default" data-aep-click-label="view-movie-Coco"> View details >> </button>
</p>
</div>
</div>
applyPropositions
命令 apply-propositions
請參閱applyPropositions
檔案以瞭解這個命令如何運作。
applyPropositions
命令是一種將主張轉譯給DOM的便利方式。 但是,在具有JSON
的程式碼型行銷活動的情況下,您可以使用此命令將現有DOM元素(或您的應用程式程式碼根據JSON
值轉譯至熒幕的元素)與主張建立關聯。
此關聯會為該元素啟動自動互動追蹤,並為該元素指派適當的主張。 若要完成此操作,請將actionType
設定為track
。
範例
alloy("sendEvent", {
renderDecisions: true,
}).then((result) => {
const {
propositions = []
} = result;
const proposition = propositions.find(
(proposition) => proposition.scope === "web://mywebsite.com/#weather-widget"
);
if (proposition) {
renderWeatherWidget(proposition); // custom code that renders the weather widget based on the code-based campaign JSON
alloy("applyPropositions", {
propositions: [proposition],
metadata: {
"web://mywebsite.com/#weather-widget": {
selector: "#weather-widget",
actionType: "track",
},
},
});
}
});
透過網路SDK標籤擴充功能啟用自動主張和互動點選追蹤 tag-extension
- 使用您的Adobe ID認證登入experience.adobe.com。
- 導覽至 資料彙集 > 標籤。
- 選取所需的標籤屬性。
- 導覽至 擴充功能,然後選取Adobe Experience Platform Web SDK卡片上的 設定。
- 向下捲動至 資料彙集 區段,然後選取核取方塊 啟用主張與互動連結追蹤。
- 選取「儲存」,然後發佈您的變更。
透過網路SDK JavaScript資料庫啟用自動主張和互動連結追蹤 library
在Web SDK中預設已啟用主張追蹤。 不過,您可以在執行configure
命令時使用autoCollectPropositionInteractions
值進一步設定它。
如果您在設定Web SDK時省略此屬性,其預設值為{"AJO": "always", "TGT": "never"}
。 如果您不想自動追蹤主張互動,請將值設為{"AJO": "never", "TGT": "never"}
。
alloy("configure", {
"edgeConfigId": "ebebf826-a01f-4458-8cec-ef61de241c93",
"orgId": "ADB3LETTERSANDNUMBERS@AdobeOrg",
"autoCollectPropositionInteractions": {"AJO": "always", "TGT": "never"}
});