注文インタラクション
注文インタラクションは、新規注文、進行中の注文、または完了した注文を管理するためにユーザが実行したアクションを取得する E コマースイベントです。
次のインタラクション名は注文インタラクションとして処理されます。
| 名前 | 値 |
|---|---|
| SalesforceInteractions.OrderInteractionName.Cancel | Cancel |
| SalesforceInteractions.OrderInteractionName.Deliver | Deliver |
| SalesforceInteractions.OrderInteractionName.Exchange | Exchange |
| SalesforceInteractions.OrderInteractionName.Preorder | Preorder |
| SalesforceInteractions.OrderInteractionName.Purchase | Purchase |
| SalesforceInteractions.OrderInteractionName.Ship | Ship |
| SalesforceInteractions.OrderInteractionName.Return | Return |
1{
2 interaction: {
3 name: 'Purchase',
4 order: {
5 orderId: '9432',
6 totalValue: 9.99,
7 currency: "USD",
8 lineItems: [{
9 catalogObjectType: 'Product',
10 catalogObjectId: 'product-xyz',
11 quantity: 1,
12 price: 9.99,
13 attributes: {
14 giftWrapping: true
15 }
16 }]
17 },
18 attributes: {
19 promoCode: "SAVE10"
20 }
21 }
22}注文インタラクション項目:
| 項目名 | 項目の型 | 説明 |
|---|---|---|
| name | string | 必須。イベント名。 |
| order.attributes | object | ユーザ指定の値。 |
| order.currency | string | 注文の通貨。 |
| order.lineItems | 品目データ | 品目データ値の配列。 |
| order.orderId | string | 必須。注文を表す一意の識別子。 |
| order.totalValue | number | 必須。注文の合計金額。 |
例
Web SDK を使用して注文インタラクションを取得する方法を次に示します。
1SalesforceInteractions.sendEvent({
2 interaction: {
3 name: 'Purchase',
4 order: {
5 orderId: '9432',
6 totalValue: 9.99,
7 currency: "USD",
8 lineItems: [{
9 catalogObjectType: 'Product',
10 catalogObjectId: 'product-xyz',
11 quantity: 1,
12 price: 9.99,
13 attributes: {
14 giftWrapping: true
15 }
16 }]
17 },
18 attributes: {
19 promoCode: "SAVE10"
20 }
21 }
22})サイトマップを使用して注文インタラクションを取得する方法を次に示します。
1SalesforceInteractions.init().then(() => {
2 const sitemapConfig = {
3 global: {},
4 pageTypes: [{
5 name: 'product_detail',
6 isMatch: () => true,
7 interaction: {
8 name: SalesforceInteractions.OrderInteractionName.Purchase,
9 order: {
10 orderId: '9432',
11 totalValue: 9.99,
12 currency: "USD",
13 lineItems: [{
14 catalogObjectType: 'Product',
15 catalogObjectId: 'product-xyz',
16 quantity: 1,
17 price: 9.99,
18 attributes: {
19 giftWrapping: true
20 }
21 }]
22 },
23 attributes: {
24 promoCode: "SAVE10"
25 }
26 }
27 }]
28 }
29 SalesforceInteractions.initSitemap(sitemapConfig)
30})