---
title: "カスタムイベント"
slug: "custom-event-1166461"
abstract: "直接HTTPリクエスト(Sitecore CDP Stream API)を使用した際のカスタムイベントのJSONオブジェクトを記述します。"
---
# カスタムイベント

::::タブ:::tab{title="2.1"}

カスタムイベントはあなたの組織に特有のものです。例えば、ほとんどの小売サイトには、ゲストが追加ボタンをクリックした瞬間をキャプチャするADDイベントがあります。しかし、例えばゲストがウィッシュリストに何回アイテムを追加するかを記録したい場合、Sitecore CDPには標準的なイベントはありません。そのためには、例えばカスタムイベントを送信できます。 ADD\_TO\_WISHLIST。

カスタムイベントがどれくらい頻繁に発生するかは、Sitecore Personalizeで実験の目標を作成することで追跡できます。また、カスタムイベントの発生を実験の勝者を宣言する基準として使うこともできます。

> !注**通知**カスタムイベントは標準イベントと同じ方法で送信します。送るカスタムイベントの名前に一貫性をつけ、標準的なイベント名は使ってはいけません。

カスタムイベントを送信するには、以下の必要な属性を使用します:

属性

種類

概要

例

channel

文字列(大文字)

ユーザーがブランドと関わる接点です。

-   "MOBILE\_APP"
-   "MOBILE\_WEB"
-   "WEB"

type

文字列(大文字)

カスタムイベントの名前です。これはお好みのカスタム値です。ただし、 [Sitecore CDPの予約イベント名](https://doc.sitecore.com/cdp/ja/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/custom-event-1166461.html#UUID-d61ee775-814d-51d9-a38c-df32d9c1927d_para-idm19016690203552312)のいずれかに値を設定してはいけません。

Sitecore CDPの予約イベント名のいずれかに値を設定してはいけません:  
  

-   イベント名は "SC\_"
-   "ADD" - 標準 [的なADD](https://doc.sitecore.com/cdp/ja/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/add-event.html) イベント。
-   "ADD\_CONSUMERS" - 標準 [ADD\_CONSUMERS](https://doc.sitecore.com/cdp/ja/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/add_consumers-event.html) イベント。
-   "ADD\_CONTACTS" - 標準 [ADD\_CONTACTS](https://doc.sitecore.com/cdp/ja/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/add_contacts-event.html) イベント。
-   "CAMPAIGN\_TRACKING" - 内部予約イベント。使用しないでください。
-   "CHECKOUT" - 標準 [的なチェックアウト](https://doc.sitecore.com/cdp/ja/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/checkout-event.html) イベント。
-   "CLEAR\_CART" - 標準 [CLEAR\_CART](https://doc.sitecore.com/cdp/ja/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/clear_cart-event.html) イベント。
-   "CONFIRM" - 標準 [的なCONFIRM](https://doc.sitecore.com/cdp/ja/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/confirm-event.html) イベント。
-   "FEEDBACK" - フィードバックイベント。
-   "IDENTITY" - 標準 [的な同一イベント](https://doc.sitecore.com/cdp/ja/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/identity-event.html) 。
-   "INTERACTION" - 内部予約イベント。使用しないでください。
-   "ORDER\_CHECKOUT" - 標準 [ORDER\_CHECKOUT](https://doc.sitecore.com/cdp/ja/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/order_checkout-event.html) イベント。
-   "PAYMENT" - 標準 [的な支払い](https://doc.sitecore.com/cdp/ja/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/payment-event.html) イベント。
-   "SUBSCRIPTION" - 内部予約イベント。使用しないでください。
-   "SEARCH" - 標準 [的なSEARCH](https://doc.sitecore.com/cdp/ja/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/search-event.html) イベント。
-   "TRACKING" - 内部予約イベント。使用しないでください。
-   "VIEW" - 標準 [的なVIEW](https://doc.sitecore.com/cdp/ja/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/view-event.html) イベント。

language

文字列(大文字 [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes))

ユーザーがアプリを使っている言語。

-   "DE"
-   "EN"
-   "FR"

currency

文字列(大文字の [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes))

ユーザーがアプリで使っている通貨のアルファベット順通貨コードです。

-   "EUR"
-   "GBP"
-   "USD"

page

ストリング

ブランドとのやり取りが行われるウェブページの名前。  
  
これはお好みのカスタム値です。

-   "home"
-   "contact-us.html"

pos

ストリング

[ブランドとのやり取りが行われる販売ポイントの名前。](https://doc.sitecore.com/cdp/ja/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/collect-required-details.html#UUID-60c4c930-3cfe-e0ad-3b98-69ceff75989f_section-idm1903325950166538)

-   "myretailsite/ireland"
-   "spinair.com/france"

browser\_id

ストリング

[ブラウザID](https://doc.sitecore.com/cdp/ja/developers/api/stream-api/direct-http-requests-reference/sending-events-1166442/retrieve-the-browser-id.html)。

"a38b230c-11eb-4cf9-8d5d-274e9f344925​"

例53。カスタムイベントオブジェクト

{
 "channel": "MOBILE\_APP",
 "type": "ADD\_TO\_WISHLIST",
 "language": "EN",
 "currency": "EUR",
 "page": "home",
 "pos": "myretailsite/ireland",
 "browser\_id": "a38b230c-11eb-4cf9-8d5d-274e9f344925​"
}

サイドバー。カスタムイベントの拡張

:::tab{title="2.1"}

例54。カスタム属性を持つカスタムイベントオブジェクト

カスタムイベントは最大50個まで設定することで拡張できます。

イベントのtype属性では、カスタムイベント名がmyretailsite:CLICKED\_POPUPとして指定されています。イベントにはカスタム属性clickedPopupとtimeBetweenPopupAndClickが含まれています。

{
 "channel": "MOBILE\_APP",
 "type": "myretailsite:CLICKED\_POPUP",
 "language": "EN",
 "currency": "EUR",
 "page": "home page",
 "pos": "myretailsite/ireland",
 "browser\_id": "a38b230c-11eb-4cf9-8d5d-274e9f344925​",
 "ext": {
 "clickedPopup": "true",
 "timeBetweenPopupAndClick": "8 seconds"
 }
}

::::::tab{title="2.1"}

例55。カスタムイベントオブジェクトで目標値をカスタムする

この例は、バリアントのパフォーマンスをカスタム[目標](https://doc.sitecore.com/personalize/en/users/sitecore-personalize/en/add-a-custom-goal-to-an-experiment-in-sitecore-personalize.html)に対して追跡するために使われるカスタムイベントを示しています。この例では、カスタムイベント名はtypeパラメータでADD\_BAGとして指定されています。イベントにはカスタム目標値bagValueと属性bagConvertedを含むextオブジェクトが含まれています。

カスタム目標がbagValueを用いてバッグの数値価格を追跡するように設定されている場合、カスタムイベントが発動するたびに、この数値はextオブジェクトから導き出され、目標計算に反映されます。

さらに、カスタム目標がbagConvertedのような追加属性も追跡するように設定されている場合、その属性の文字列値を使ってカスタムイベントの成功を判断できます。

{
 "channel": "WEB",
 "type": "ADD\_BAG",
 "language": "EN",
 "currency": "EUR",
 "page": "home page",
 "pos": "myeurosite",
 "browser\_id": "a38b230c-11eb-4cf9-8d5d-274e9f344925",
 "ext": {
 "bagValue": "1234",
 "bagConverted": "true"
 }
}

:::::::

::::::tab{title="2.0"}

2.0のデータモデルはこの機能をサポートしていません。

:::