autoCollectPropositionInteractions
autoCollectPropositionInteractions プロパティは、Web SDKが提案インタラクションを自動的に収集するかどうかを決定するオプション設定です。 値は意思決定者のマップで、各プロバイダーは、自動提案インタラクションの処理方法を示す値を持ちます。
提案インタラクションの自動追跡を有効にすると、DOMにレンダリングされた提案エレメント内のクリックは、Web SDKによって自動的に収集されます。 このコレクションには、Web SDKによってDOMに自動的にレンダリングされたエクスペリエンスと、applyPropositions コマンドを使用してDOMにレンダリングされたエクスペリエンスが含まれます。
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"
}
});
このオブジェクトでサポートされるプロパティには、次のものがあります。
AJOTGT各プロパティに使用できる値は次のとおりです。
alwaysinteract イベントを自動的に収集します。neverinteract イベントを自動的に収集しない。decoratedElementsOnlyinteract イベントを自動的に収集します。データ属性 data-attributes
エレメントにデータ属性を使用して、インタラクションに特異性を追加できます。
data-aep-click-labeldata-aep-click-tokendata-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/alpha.jpg" class="poster" />
<h2>Example Movie Alpha</h2>
<p class="description"> A lighthearted story about exploration and friendship set on a distant world. Follow a curious rover who discovers that small actions can lead to big changes.</p>
<p>
<button class="btn btn-default" data-aep-click-label="view-movie-Example-Alpha">View details</button>
</p>
</div>
<div class="col-md-4 movie" data-aep-click-token="6ZUrou9BVKIsINIAqxylzw">
<img src="/img/bravo.jpg" class="poster" />
<h2>Example Movie Bravo</h2>
<p class="description">An uplifting tale of a determined chef who overcomes unlikely odds to create culinary masterpieces in a bustling city bistro.</p>
<p>
<button class="btn btn-default" data-aep-click-label="view-movie-Example-Bravo">View details</button>
</p>
</div>
<div class="col-md-4 movie" data-aep-click-token="QuuXntMRGnCP/AsZHf4pnQ">
<img src="/img/charlie.jpg" class="poster" />
<h2>Example Movie Charlie</h2>
<p class="description">A vibrant adventure following a young musician who journeys into a fantastical realm to find the true meaning of family and tradition.</p>
<p>
<button class="btn btn-default" data-aep-click-label="view-movie-Example-Charlie">View details</button>
</p>
</div>
</div>
applyPropositions コマンドでautoCollectPropositionInteractionsを使用 apply-propositions
applyPropositions コマンドは、DOMに提案をレンダリングする便利な方法です。 ただし、JSONを使用したコードベースのキャンペーンの場合は、このコマンドを使用して、既存のDOM要素(またはJSON値に基づいて画面にレンダリングされたアプリケーションコード)を提案と関連付けることができます。
この相関関係は、その要素に対して自動インタラクション追跡をアクティブ化し、その要素に適切な提案を割り当てます。 これを実現するには、actionTypeをtrackに設定します。
alloy("sendEvent", {
renderDecisions: true,
}).then((result) => {
const {
propositions = []
} = result;
const proposition = propositions.find(
(proposition) => proposition.scope === "web://example.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://example.com/#weather-widget": {
selector: "#weather-widget",
actionType: "track",
},
},
});
}
});
Web SDK タグ拡張機能の提案インタラクションの自動設定
Web SDK タグ拡張機能を設定する際の次の2つのドロップダウンメニューは、このオブジェクトと同等のタグです。