{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"リアルタイムパーソナライゼーション2.0サーバーサイドユースケースガイド","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"リアルタイムパーソナライゼーション20サーバーサイドユースケースガイド","__idx":0},"children":["リアルタイムパーソナライゼーション2.0サーバーサイドユースケースガイド"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"はじめにと概要","__idx":1},"children":["はじめにと概要"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["リアルタイムパーソナライゼーション2.0は、顧客プロファイルの属性・行動・セグメントに関する即時かつコンテキストに沿った情報を提供するデータエンジンです。Webやモバイルインターフェイスのリアルタイムなパーソナライゼーションを実現するために設計されています。",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ja/products/customer-data-platform/real-time/about-real-time-personalization"},"children":["リアルタイムパーソナライゼーションの詳細はこちら"]},"をご覧ください。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["リアルタイムパーソナライゼーション2.0は、クライアントサイド構成・サーバーサイド構成のどちらでも実装できます。このガイドはサーバーサイド実装に焦点を当てています。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["このステップバイステップガイドでは、シンプルなWebアプリケーションを題材に、リアルタイムパーソナライゼーション2.0のサーバーサイドユースケースを構築・実装する方法を紹介します。データの取り込みと属性設定から、オーディエンスセグメンテーション、下流の統合まで、全体のプロセスを順を追って説明します。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"リアルタイムパーソナライゼーション20について","__idx":2},"children":["リアルタイムパーソナライゼーション2.0について"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["リアルタイムパーソナライゼーション2.0（RT 2.0）は、モダンなサーバー間のプッシュ/プルAPIアーキテクチャを提供します。行動データの迅速な取り込みと、Treasure DataのAudience Studioで定義したパーソナライゼーションルールやセグメントに対するリアルタイム評価の両方を実現します。ユーザーは、サインアップやログイン、商品閲覧などのイベントに即座に反応し、パーソナライゼーション向けのペイロードを返す体験を設計できます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["RT 2.0パーソナライゼーションAPIとRT 1.0（Profiles API）の比較"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Feature"},"children":["Feature"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"RT 1.0"},"children":["RT 1.0"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"RT 2.0"},"children":["RT 2.0"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Method"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ルックアップキーを送るGET"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["データを取り込むPOST"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Endpoint"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["cdp.in.treasuredata.com"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["us01.p13n.in.treasuredata.com"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Access"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK（クライアントサイド）"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["サーバー間通信"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Response & String-build"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["セグメント、バッチ属性"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["バッチ+リアルタイム属性とセグメント"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SLA"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["保証なし"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["100ms"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Token"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["UIで作成"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["UI＋手動設定"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Latency: Batch Update"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["トークンWF実行＋PSワークフロー"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ワークフロー実行＋RT同期実行"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["リアルタイムパーソナライゼーション1.0と比べると、2.0（サーバーサイド）はより包括的で低レイテンシーなレスポンスを提供します。サーバーサイドのユースケースと準リアルタイムアクティベーションに最適化されています。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下のセクションでは、Webアプリケーション向けにリアルタイムパーソナライゼーション2.0を設定する方法を紹介します。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ステップ1-データ取り込みとapiオプション","__idx":3},"children":["ステップ1: データ取り込みとAPIオプション"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["このステップでは、WebアプリからTreasure Data CDPへのデータフローを設定する方法を説明します。主要な取り込みAPIとテーブル/セグメント設計のベストプラクティスに焦点を当てます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["既にCDPテーブルにデータを送信している場合も、新たなパーソナライゼーションユースケースに合わせてテーブルを準備する場合も、行動イベントを個別のテーブルにマッピングし、下流で「ペアレントセグメント」として活用するようにしてください。これらのセグメントがRT 2.0構成の基盤になります。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["RT 2.0をセットアップした後は、テーブルやセグメントを継続的に更新しても、構成を再申請する必要はありません。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"ingestion-apiとsdk-41の比較","__idx":4},"children":["Ingestion APIとSDK 4.1の比較"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["SDK 4.1: ブラウザ/クライアントサイドからデータを送信します。実装は容易ですが、機密性の高いPIIやビジネスロジックを扱う場合はセキュリティリスクが高くなる可能性があります。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ingest API: サーバーやサーバーレス（例: AWS Lambda）からイベントデータを送信します。セキュリティと制御の観点から推奨される方法です。"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"lambdaサーバーサイドを使った取り込み例","__idx":5},"children":["Lambda（サーバーサイド）を使った取り込み例"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ingest APIエンドポイント:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://us01.records.in.treasuredata.com"},"children":["https://us01.records.in.treasuredata.com"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://eu01.records.in.treasuredata.com"},"children":["https://eu01.records.in.treasuredata.com"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://ap02.records.in.treasuredata.com"},"children":["https://ap02.records.in.treasuredata.com"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://ap01.records.in.treasuredata.com"},"children":["https://ap01.records.in.treasuredata.com"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["リージョンごとのbaseURLについては",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/endpoints/endpoints"},"children":["Treasure Dataドキュメント"]},"をご確認ください。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ingest APIとPersonalization APIの違いは何ですか？"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ingest API: イベントデータをCDPに送信し、保存および後でのセグメンテーションに利用します。レスポンスでパーソナライゼーションペイロードは返しません。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Personalization API: イベントデータを取り込み、直ちにパーソナライゼーションロジックを評価して、Audience Studioで定義したルールに基づくリアルタイムペイロードを返します。"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ニュースレター登録イベントを送信する例:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ingest APIの場合: イベントデータをPOSTして将来のセグメント更新に利用し、別途API呼び出し（または下流処理）でセグメントや属性情報を取得します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Personalization APIの場合: 1回のAPI呼び出しでイベントを取り込み、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["user_status: subscribed"]}," や ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["segment_membership: batch_subscribed_users"]}," のようなリアルタイムフラグをレスポンスで受け取ります。"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Personalization APIエンドポイント:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://us01.p13n.in.treasuredata.com"},"children":["https://us01.p13n.in.treasuredata.com"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://eu01.p13n.in.treasuredata.com"},"children":["https://eu01.p13n.in.treasuredata.com"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://ap01.p13n.in.treasuredata.com"},"children":["https://ap01.p13n.in.treasuredata.com"]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Personalization APIは、取り込みとリアルタイム評価を1つのAPI呼び出しで実現し、統合の簡素化・レイテンシ削減・即時の体験提供を可能にします。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Personalization APIリクエスト例:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"td_client_id\":\"1986b2a4-3957-4863-be2c-7ef36a14afee\",\n  \"td_url\":\"https://treasuredemos.com/retail\",\n  \"td_path\":\"/retail\"\n  // additional properties...\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Personalization APIレスポンス例:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"offers\": {\n    \"First-Time-Visitor\": {\n      \"attributes\": {\n        \"newsletter_section\": \"show\"\n      },\n      \"batch_segments\": null\n    }\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ステップ2-uiでのリアルタイムパーソナライゼーション設定","__idx":6},"children":["ステップ2: UIでのリアルタイムパーソナライゼーション設定"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["このステップでは、リアルタイムパーソナライゼーション2.0の有効化を依頼する方法、Treasure DataのUIで主要機能を設定する手順、APIアクセス用のパーソナライゼーショントークンを管理する方法を紹介します。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"rt-personalization-20の有効化","__idx":7},"children":["RT Personalization 2.0の有効化"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["アカウントでRT Personalization 2.0を有効化するには、次の手順に従います。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["まずAudience Studioでペアレントセグメントを作成します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["次に、カスタマーサクセスマネージャー（CSM）にリアルタイムパーソナライゼーション2.0機能の有効化を依頼します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["CSMには以下の情報を提供してください。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["AWSインスタンス名"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["環境（本番、ステージングなど）"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ペアレントセグメントID"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["アカウントで機能が有効化されると、次の情報が提供されます。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["有効化前/後のスクリーンショットによる確認"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["パーソナライゼーション2.0トークンを作成する際に使用する Reactor Instance Configuration（例: a11874n4）"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"リアルタイムパーソナライゼーション20の構成","__idx":8},"children":["リアルタイムパーソナライゼーション2.0の構成"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Treasure コンソールでリアルタイムパーソナライゼーション2.0を設定するには、次の手順を実行します。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["対象のペアレントセグメントを選択します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Configuration Options画面の「Personalization Configuration」セクションで「Configure settings」ボタンをクリックします。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["パーソナライゼーションサービスの一覧が表示されたデータグリッドに移動します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["「Create new personalized service」ボタンをクリックします。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["パーソナライゼーションサービスの名前を入力し、必要に応じて説明を追加します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["SSO/ID検証に関するメッセージが表示される場合があります。アカウントがユーザー名＋パスワードの場合でも、SSO用のメッセージが表示されることがあります。サインアウト・サインインで解決するケースがあります。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["右側のパネルで「+ Add token」ボタンをクリックします。"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["パーソナライゼーショントークンの作成と管理:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["各パーソナライゼーショントークンに名前を付けます。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["サービスタイプとしてPublicまたはPrivateを選択します。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["IP WhitelistはPrivateサービスでのみ設定できます。指定したIPアドレスの範囲からのみアクセスが可能になります。IPアドレスを指定しない場合は、Treasure アカウントのIPホワイトリスト設定が適用されます。"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["必要に応じてトークンを特定のIPアドレス範囲に制限できます（任意）。空欄の場合は、アカウントのIPホワイトリストが適用されます。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["各APIトークンの形式は ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[YOUR_ACCOUNT_INSTANCE_ID]/[REACTOR_INSTANCE_ID]/[RT_PERSONALIZATION_TOKEN]"]}," です。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["例: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["11874/3/YOUR_TOKEN"]}]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Postmanやサーバーコードで利用する場合は、ヘッダーに ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"WP13n-Token\": \"11874/3/YOUR_TOKEN\""]}," の形式で設定します。"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["1つのパーソナライゼーションインスタンスにつき複数のトークンを作成できます。ステージングと本番でアクセス権を分けたり、将来的にサーバー用とクライアント用でトークンを分離したりする際に便利です。Treasure Dataでは、パーソナライゼーションサービスごとに最大50個、ペアレントセグメント全体で最大200個のトークンを利用できます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["検証時の注意点:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["トークンを後から閲覧する際、再ログインを求められることがあります（セキュリティのため正常な動作です）。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["V4 UIとV5 UIで挙動が異なる場合があります。V4はパスワード検証、V5はSSOプロンプトが表示されることがあります。"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ステップ3-イベントと属性の定義","__idx":9},"children":["ステップ3: イベントと属性の定義"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["パーソナライゼーションサービスの設定後は、イベントテーブル、イベントフィルタ、関連属性を定義します。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"イベントテーブルとイベント定義","__idx":10},"children":["イベントテーブルとイベント定義"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Real-Time Configurationセクションで、利用するストリーミングイベントテーブルをすべて追加します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["イベントを新規作成する手順:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["「Create new event」をクリック"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["イベントに名前を付ける"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ソーステーブルを選択する"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["必要に応じて特定アクションをフィルタリング（例: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td_path"]}," の正規表現で商品ページ閲覧を抽出）"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["商品ページ閲覧のイベントフィルタ例:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td_path"]}," 正規表現: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["^/retail/.*/product/.*"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["属性の定義（Attributesタブ）:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["属性タイプごとに感度を設定しながら追加します。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Single: ユーザーの最新値（文字列/数値）を保持。機密/非機密のいずれかに設定可能。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["List: 最大100件の配列（例: 閲覧した商品）を保持し、各要素は60日で期限切れ。機密/非機密のいずれかに設定可能。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Counter: イベントの回数や数値合計を追跡。スライディング（ローリングウィンドウ）と累積モードをサポート。非機密のみ設定可能。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Imported Batch: バッチセグメントから値を参照。リアルタイムイベントでは更新されず、ペアレントセグメントの再実行でのみ更新。機密/非機密のいずれかに設定可能。"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["注意: 属性の感度は機密または非機密に分類できます。APIレスポンスで公開されるのは非機密属性のみです。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Single属性のポイント:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["最新イベント値（例: 最後に閲覧した商品）を保持します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["各属性にはシステムIDがあり、名称変更で新しいシステムIDが発行されます。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["履歴データを取り込む場合はBatch Backfill（タイムスタンプ整合を伴うバッチインポート）を使用します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["リアルタイム属性とバッチ属性の名前/エイリアスが衝突しないように設計してください。"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["List属性のポイント:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["セッションや直近ユースケース向け（例: 「過去X時間に閲覧した商品」）で、文字列/数値の配列を保持します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["バッチのバックフィルはできません。必要に応じてバッチ用とリアルタイム用で属性を分けます。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["集計オプション: First、Last、Sum、Min、Max、Distinct List。Sum/Min/Maxは数値型のみ利用可能など、戻り値の制約があります。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ユースケースとして、最新アクション、ユニークアイテム、直近リストなどがあり、マッピングや取り込み形式を慎重に設計する必要があります。"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["既知のList属性の挙動:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["メインの ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["value_field_name"]}," が文字列の場合、集計用にリストが「フラット化」されます。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["価格やURLなどのプロパティを配列としてマッピングすると、最後の要素だけでなくJSONリスト全体が保持されます。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ワークアラウンドとして、イベントを粒度の細かい単位で送信する、またはすべての項目プロパティをバッファ属性としてマッピングする方法があります。"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Counter属性のポイント:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["定義した期間内でイベント発生数や合計値をカウントします。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["スライディングカウンター: 指定した期間（分・時間・日）のローリングウィンドウ。サブ期間（例: 日次内の時間単位）を最大20個まで定義可能。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["累積カウンター: 固定の破棄ウィンドウ（最大60日）内で累積します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["粒度とシステム制約のバランスを考慮して期間を設定してください。"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Imported Batch属性のポイント:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ペアレントセグメントで定義されている場合、リアルタイムペイロードに含められます。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["RT構成で追加・削除できますが、リアルタイム取り込みで更新されることはなく、ペアレントセグメントの再実行でのみ値が更新されます。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ペアレントセグメントからバッチ属性を削除し、RT構成を更新しないままだとエラーになります。必要に応じてペアレントセグメントに再追加して実行するか、ダミーテーブル/属性を作成してください。"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["属性設計のベストプラクティス:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["属性/システム名の計画を行い、衝突を避けます。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["バッチ経路とリアルタイム経路の両方で属性更新をテストし、一貫性を確認します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["集計ロジックとウィンドウ期間を事前に定義します。"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ステップ4-プロファイル統合とidステッチ","__idx":11},"children":["ステップ4: プロファイル統合とIDステッチ"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["IDステッチは、バッチデータとリアルタイムデータをプロファイルレベルで統合し、複数の識別子（メール、クライアントIDなど）を単一の顧客ビューにまとめます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["IDステッチの設定方法:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["「stitching keys」を定義します（例: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td_client_id"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["email"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["canonical_id"]},"）。正規表現でのフィルタや、バッチ専用として「workflow only」を設定することも可能です。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["構成を保存したら、利用可能なキーからプライマリキーを選択します。プライマリキーはペアレントセグメント内の全プロファイルで一意かつ安定している必要があります。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["プライマリキーを設定後、ワークフローを再起動しない限りステッチ処理は有効になりません。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["システムは最も古いIDをプライマリとして選択し、プロファイルを統合します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ステッチキーは最大200個まで定義できます。"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ベストプラクティスと注意事項:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["イベントデータが提供するIDを計画し、バッチ経路とリアルタイム経路で整合させます。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["プライマリキーの設定は慎重に行ってください。稼働後に変更する場合は、システムの再実行が必要になります。"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["例:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["新しいイベントにメールが含まれ、既存プロファイルが ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td_client_id"]}," で存在する場合、最も古いIDがプライマリとして統合されます。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["除外値やフィルタを設定することで、テスト用・誤った識別子を無視できます。"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ステップ5-audience-studioでのパーソナライゼーション構築と管理","__idx":12},"children":["ステップ5: Audience Studioでのパーソナライゼーション構築と管理"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["イベントと属性を設定したら、Audience Studioでパーソナライゼーションロジックを構築・管理します。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["新しいパーソナライゼーションの作成:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["左側のサイドバーで親/マスターセグメントにアクセスします。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["「Create」をクリックし、「Personalization」を選択して名前を付けます。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["パーソナライゼーションを開き、Personalization Canvasに進みます。"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["セクションを追加して条件とペイロードを設定:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["各セクションには以下が含まれます。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Criteria: パーソナライゼーションを発火させる条件（例: 未知ユーザーの場合は「email is null」、既知ユーザーの場合は「email is not null」）。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Payload: 条件に一致した際に返すデータ。バッチ属性とリアルタイム属性を追加し、必要に応じてエイリアスやバッチセグメントを設定します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ペイロードに機密扱いのリアルタイム属性またはインポート属性が含まれると、セクション名の横に感度アイコンが表示されます。"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["考慮事項:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["パーソナライゼーションで使用するイベントが、想定するトリガーと合致している必要があります。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ステッチキーが正しく構成されていないと、属性伝播に問題が生じます。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["下流のマッピング用に、各ペイロードフィールドにエイリアスを設定してください。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["SLA 100msを満たすため、ペイロードサイズは10KB未満、属性数は20個以下に抑えてください。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["バッチセグメントや属性を変更した場合は、親/マスターセグメントのワークフローを再実行し、最新の結果を反映させてください。"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["UIワークフローのヒント:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["「Save payload」をクリックするとボタンが無効化されます。完了するには「Cancel」を2回押してから「Save & Launch」をクリックします。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["UIの読み込みに時間がかかる場合があります。必要に応じてリフレッシュしてください。"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ステップ6-api統合と実装例","__idx":13},"children":["ステップ6: API統合と実装例"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["このセクションでは、アプリケーションコードやデプロイ環境でRT 2.0パーソナライゼーションAPIを統合するための実装ガイドを紹介します。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["APIエンドポイント形式:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["米国リージョン: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://us01.p13n.in.treasuredata.com/{YOUR_DB_NAME}/{tableName}"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["YOUR_DB_NAME"]},": ストリーミングイベントデータベース"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tableName"]},": 対象イベントを保持するテーブル"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["必要なヘッダー:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"Content-Type\": \"application/vnd.treasuredata.v1+json\""]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"Authorization\": \"TD1 [TD_API_KEY]\""]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"WP13n-Token\": \"[YOUR_ACCOUNT_INSTANCE_ID]/[REACTOR_INSTANCE_ID]/[RT_PERSONALIZATION_TOKEN]\""]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["リクエストボディ例（JSON）:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"td_client_id\": \"42a508e2-d9b1-4baa-9eb2-6c3fb8bd5e16\",\n  \"td_url\": \"https://treasuredemos.com/retail/shop/women\",\n  \"td_path\": \"/retail/shop/women\",\n  \"product_name\": \"women’s-tank-top\",\n  \"product_category\": \"women\",\n  \"product_list\": [\"women’s-running-shoes\", \"kids’-hoodie\", \"women’s-tank-top\"],\n  \"category_list\": [\"women\", \"kids\"]\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Node.js Lambda（サーバーサイド）でのAPIリクエスト例:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"jsconst fetch = require(\"node-fetch\");\nexports.lambdaHandler = async (event) => {\n    try {\n        const tableName = event.pathParameters?.tableName || null;\n        const requestBody = event.body ? JSON.parse(event.body) : {};\n        if (!tableName) {\n            return { statusCode: 400, body: JSON.stringify({ error: \"Missing tableName parameter\" }) };\n        }\n        if (!requestBody.td_client_id) {\n            return { statusCode: 400, body: JSON.stringify({ error: \"Missing td_client_id\" }) };\n        }\n        const response = await fetch(`https://us01.p13n.in.treasuredata.com/{YOUR_DB_NAME}/${tableName}`, {\n            method: \"POST\",\n            headers: {\n                \"Content-Type\": \"application/vnd.treasuredata.v1+json\",\n                \"Authorization\": `TD1 ${process.env.TD_API_KEY}`,\n                \"WP13n-Token\": process.env.PERSONALIZATION_TOKEN\n            },\n            body: JSON.stringify(requestBody)\n        });\n        if (!response.ok) {\n            throw new Error(`Treasure Data API returned status: ${response.status}`);\n        }\n        const data = await response.json();\n        return { statusCode: 200, body: JSON.stringify(data) };\n    } catch (error) {\n        return { statusCode: 500, body: JSON.stringify({ error: error.message }) };\n    }\n};\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Personalization APIレスポンスの例（非機密属性を含む場合）:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"offers\": {\n    \"Welcome to our website!\": {\n      \"attributes\": {\n        \"welcome_message\": \"Welcome to our website! Enjoy your shopping!\"\n      }\n    },\n    \"Silver rewards just for you!\": {\n      \"attributes\": {\n        \"real-time_single_attribute_first_name\": \"John\",\n        \"real-time_counter_attribute_total_purchase\": 28700,\n        \"real-time_list_attribute_items_purchased\": [],\n        \"order_summary\": \"Here is your order summary!\",\n        \"thank_you_message\": \"Thanks you for shopping with us!\",\n        \"promotions_message\": \"Enjoy your 15% discount for your next purchase!\"\n      }\n    },\n    \"Golden membership offer!\": {\n      \"attributes\": {\n        \"customer_name\": \"John\",\n        \"order_total\": 28700,\n        \"list_reactor_offers_ak_1 - aggr1_path_list_reactor_offers_ak_1\": [\n          \"/06130004\",\n          \"/promotion\",\n          \"/silver\"\n        ],\n        \"rewards_message\": \"You have spent $300 on eligible purchases. Your Rewards Certificate(s) are ready for you!\"\n      }\n    }\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Personalization APIレスポンスの例（機密属性が除外される場合）:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"offers\": {}\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["デプロイ手順:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ローカルで依存パッケージをインストールします（",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["npm install node-fetch"]},"）。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["パッケージ化してLambdaにアップロードします。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["APIキーとパーソナライゼーショントークンをLambdaの環境変数として設定します。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["API GatewayでPOSTエンドポイントを作成し、Lambdaをトリガーします。"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["クライアントサイドからのFetch例:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"jsconst apiUrl = \"https://{your-api-id}.execute-api.{region}.amazonaws.com/dev/fetch-treasure-data/user_data\";\nfetch(apiUrl, {\n    method: \"POST\",\n    headers: { \"Content-Type\": \"application/json\" },\n    body: JSON.stringify({\n        td_client_id: \"12345\",\n        email: \"user@example.com\",\n        td_url: \"https://example.com/\",\n        td_path: \"/\"\n    })\n})\n.then(response => response.json())\n.then(data => console.log(\"Personalization Response:\", data));\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以上で、シンプルなWebアプリケーションを対象にリアルタイムパーソナライゼーション2.0（サーバーサイド）を構成する方法の紹介は終了です。"]}]},"headings":[{"value":"リアルタイムパーソナライゼーション2.0サーバーサイドユースケースガイド","id":"リアルタイムパーソナライゼーション20サーバーサイドユースケースガイド","depth":1},{"value":"はじめにと概要","id":"はじめにと概要","depth":2},{"value":"リアルタイムパーソナライゼーション2.0について","id":"リアルタイムパーソナライゼーション20について","depth":2},{"value":"ステップ1: データ取り込みとAPIオプション","id":"ステップ1-データ取り込みとapiオプション","depth":2},{"value":"Ingestion APIとSDK 4.1の比較","id":"ingestion-apiとsdk-41の比較","depth":3},{"value":"Lambda（サーバーサイド）を使った取り込み例","id":"lambdaサーバーサイドを使った取り込み例","depth":3},{"value":"ステップ2: UIでのリアルタイムパーソナライゼーション設定","id":"ステップ2-uiでのリアルタイムパーソナライゼーション設定","depth":2},{"value":"RT Personalization 2.0の有効化","id":"rt-personalization-20の有効化","depth":3},{"value":"リアルタイムパーソナライゼーション2.0の構成","id":"リアルタイムパーソナライゼーション20の構成","depth":3},{"value":"ステップ3: イベントと属性の定義","id":"ステップ3-イベントと属性の定義","depth":2},{"value":"イベントテーブルとイベント定義","id":"イベントテーブルとイベント定義","depth":3},{"value":"ステップ4: プロファイル統合とIDステッチ","id":"ステップ4-プロファイル統合とidステッチ","depth":2},{"value":"ステップ5: Audience Studioでのパーソナライゼーション構築と管理","id":"ステップ5-audience-studioでのパーソナライゼーション構築と管理","depth":2},{"value":"ステップ6: API統合と実装例","id":"ステップ6-api統合と実装例","depth":2}],"frontmatter":{"seo":{"title":"リアルタイムパーソナライゼーション2.0サーバーサイドユースケースガイド"}},"lastModified":"2026-06-01T09:34:27.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/products/customer-data-platform/real-time/real-time-personalization-2-0-server-side-use-case-guide","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}