adobe.target.sendNotifications(options)
最終更新日: 2024年7月22日
作成対象:
- 開発者
この関数は、adobe.target.applyOffer()
または adobe.target.applyOffers()
を使用せずにエクスペリエンス Target レンダリングされたときにエッジに通知を送信します。
この関数は、at.js 2.1.0 で導入され、2.1.0 以上の任意のバージョンで使用できます。
キー | タイプ | 必須? | 説明 |
---|---|---|---|
consumerId | 文字列 | × | 指定しない場合、デフォルト値はクライアントのグローバル mbox です。このキーは、A4T 統合に使用される補助的なデータ ID を生成するために使用されます。 |
リクエスト | オブジェクト | ○ | 下の「リクエスト」の表を参照してください。 |
timeout | 数値 | × | リクエストのタイムアウト。指定しない場合、at.js のデフォルトのタイムアウトが使用されます。 |
リクエスト
フィールド名 | タイプ | 必須? | 制限事項 | 説明 |
---|---|---|---|---|
Request > notifications | オブジェクトの配列 | ○ | 表示されるコンテンツに対する通知、クリックされたセクター、訪問されたビューまたは mbox。 | |
Request > notifications > address | オブジェクト | × | ||
Request > notifications > address > url | 文字列 | × | 通知の送信元の URL。 | |
Request > notifications > address > referringUrl | 文字列 | × | 通知の送信元のリファラル URL。 | |
Request > notifications > parameters | 文字列 | × |
以下の名前はパラメーターに使用できません。
次の点に留意してください。
| |
Request > notifications > profileParameters | 文字列 | × |
以下の名前はパラメーターに使用できません。
次の点に留意してください。
| |
Request > notifications > order | オブジェクト | × | 注文の詳細を説明するオブジェクト。 | |
Request > notifications > order
| 文字列 | × | <= 250 文字。 | 注文 ID。 |
Request > notifications > order
| 文字列 | × | >= 0 | 合計注文額。 |
Request > notifications > order
| 文字列の配列 | × |
| 注文製品 ID。 |
Request > notifications > product | オブジェクト | × | ||
Request > notifications > product > id | 文字列 | × | <= 128 文字。空にできない。 | 製品 ID。 |
Request > notifications > product > categoryId | 文字列 | × | <= 128 文字。空にできない。 | カテゴリ ID. |
Request > notifications > id | 文字列 | ○ | <= 200 文字。 | 通知 ID は応答で返され、通知が正常に処理されたことを示す。 |
Request > notifications > impressionId | 文字列 | × | <= 128 文字。 | インプレッション ID が、現在の通知を以前の通知とスティッチ(リンク)したり、リクエストを実行したりするのに使用される。それらの両方が一致する場合、2 番目以降のクエストはアクティビティまたはエクスペリエンスに新しいインプレッションを生成しません。 |
Request > notifications > type | 文字列 | ○ | 「クリック」または「ディスプレイ」がサポートされています。 | 通知タイプ。 |
Request > notifications > timestamp | 数値 <int64> | ○ | UNIX エポックから経過したミリ秒で示す通知のタイムスタンプ。 | |
Request > notifications > tokens | 文字列の配列 | ○ | 通知のタイプに基づく、表示されたコンテンツまたはクリックされたセクターのトークンのリスト。 | |
Request > notifications > mbox | オブジェクト | × | mbox の通知。 | |
Request > notifications > mbox
| 文字列 | × |
空の値は許可されない。 許可される文字:この表の後のメモを参照してください。 | mbox 名。 |
Request > notifications > mbox
| 文字列 | × | mbox 状態トークン。 | |
Request > notifications > view | オブジェクト | × | ||
Request > notifications > view
| 整数 <int64> | × | ビュー ID。ビューがビュー API で作成された際にビューに割り当てられた ID。 | |
Request > notifications > view
| 文字列 | × | <= 128 文字。 | ビューの名前。 |
Request > notifications > view
| 文字列 | × | <= 512 文字。 | ビューキー。API でビューに設定されたキー。 |
Request > notifications > view
| 文字列 | × | ビュー状態トークン。 |
注意:次の文字は Request > notifications > mbox > name
では使用できません 使用できません。
- '-, ./=`:;&!@#$%^&*()+|?~[]{}'
プリフェッチされた mbox のレンダリング後の sendNotifications() 呼び出し
function createTokens(options) {
return options.map(e => e.eventToken);
}
function createNotification(mbox, type, tokens) {
const id = 11111; // here we should use a random ID like UUID
const timestamp = Date.now();
const { name, state, parameters, profileParameters, order, product } = mbox;
const result = {
id,
type,
timestamp,
parameters,
profileParameters,
order,
product
};
result.mbox = { name, state };
result.tokens = tokens;
return result;
}
adobe.target.getOffers({
request: {
prefetch: {
mboxes: [
{
index: 0,
name: "a1-serverside-ab"
}
]
}
}
})
.then(response => {
const mboxes = response.prefetch.mboxes;
const notifications = mboxes.map(mbox => {
const type = "display";
const tokens = createTokens(mbox.options);
return createNotification(mbox, type, tokens);
});
adobe.target.sendNotifications({
request: { notifications }
});
})
Adobe Analytics、
getOffers()
を prefetch のみおよび sendNotifications()
と共に使用している場合は、sendNotifications()
の実行後に Analytics リクエストを実行する必要があります。 この目的は、sendNotifications()
によって生成された SDID が、Analytics と Target に送信された SDID と一致することを確認することです。recommendation-more-help
6906415f-169c-422b-89d3-7118e147c4e3