> For the complete documentation index, see [llms.txt](https://help.citrusad.com/retail-media-interface/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.citrusad.com/retail-media-interface/integration/ja/data-api/audience-targeting-new/integration-option-2-sync-customers-audience.md).

# オプション2: 顧客とオーディエンスの同期

### 概要

クリーンルームや自家管理のオーディエンスセグメントを持つリテールメディア事業者は、顧客およびセグメントデータを同期して、トップ広告主向けや一般オーディエンス向けのカスタムオーディエンス配信を有効にすることができます。この連携には、CDPを使用して顧客/セグメント情報を以下に提供することが含まれます: Epsilon。APIまたはファイルのいずれか経由。

### 連携の要件

* 標準的なオンサイト連携には、利用可能なすべてのタッチポイントにわたって顧客IDが含まれている必要があります。
* 顧客IDのフィード（APIまたはファイルフィード経由）。
* セグメントフィード（APIまたはファイルフィード経由）。

### 仕組み

CDPまたはオーディエンスプラットフォームは、以下に対して顧客データおよびセグメントデータを提供します: Epsilon ファイルアップロードまたはAPIを使用します。広告リクエストに含まれる顧客IDは、オーディエンスセグメントおよび関連するキャンペーンと照合されます。これにより、カスタムまたは一般的なオーディエンス定義に基づく正確なターゲティングが可能になります。

<figure><img src="/files/hwSOaMD5BsY7S8PK0gUz" alt="" width="100%"><figcaption></figcaption></figure>

### 連携の例

**広告リクエスト例**: 顧客IDを含む広告リクエスト:

```http
POST $BASE_URL/v1/ads/generate HTTP/1.1
accept: application/json
content-type: application/json
Authorization: Basic <API_KEY>
{
    "customerId": "wertg5432a",
    "sessionId": "ec9-4e07-881d-3e9",
    "dtmCookieId": "AAAF8xLBTA968AB6TOthAAAAAAE",
    "placement": "search",
    "catalogId": "628dbe95-2ec9-4e07-881d-3e9f92ab2e0b",
    "searchTerm": "chocolate",
    "options": {
        "filterMode": "AndOr"
    },
    "maxNumberOfAds": 3
}
```

{% hint style="info" %}
広告リクエストには以下が含まれている必要があります `customerId`（ファイル連携かAPI連携かを問わず）。
{% endhint %}

### フィードファイル同期連携（推奨）

ファイルで顧客とセグメントを同期する場合、2つのファイルが必要です:

* セグメントファイル
* 顧客ファイル

#### セグメントファイル

セグメントファイルは、UIに表示されるセグメントID、名前、および説明を提供するために使用されます。また、セグメントを閲覧できる特定のteam\_idsを指定するためにも使用でき、特定の広告主向けにセグメントをキュレートすることができます。

| segment\_id       | name                   | description                | team\_ids                                                                        |
| ----------------- | ---------------------- | -------------------------- | -------------------------------------------------------------------------------- |
| general-segment-1 | 高額購入ショッパー              | 週平均の買い物が上位15%に入るショッパー。     |                                                                                  |
| general-segment-2 | お得感重視のショッパー            | バスケット内の価値追求型商品の割合が高いショッパー。 |                                                                                  |
| general-segment-3 | リピートショッパー              | 平均して毎週買い物をするショッパー。         |                                                                                  |
| custom-segment-1  | カスタム: BrandCo 直近高頻度購入者 | 過去30日以内にBrandCoを購入した顧客。    | \["a5166fc4-f874-4741-a721-c05ffd9941a5","92f4b91f-0089-4102-b13b-6015da8e0174"] |

セグメントリファレンスガイドを表示 [こちら](/retail-media-interface/integration/ja/references/audience-targeting-reference.md#segment-feed-required-when-syncing-your-own-segments).

#### 顧客ファイル

顧客ファイルは単一の顧客を作成し、それらをセグメントに紐付けるために使用されます。提供する必要があるのは以下のみです: `customer_id` および `segment_ids`

| customer\_id | segments                                    |
| ------------ | ------------------------------------------- |
| cust\_12345  | \["general-segment-3", "general-segment-4"] |
| cust\_67890  | \["general-segment-3"]                      |

顧客リファレンスガイドを表示 [こちら](/retail-media-interface/integration/ja/references/audience-targeting-reference.md#customer-feed-required-when-syncing-your-own-segments-and-customers).

{% hint style="info" %}
1顧客あたり最大100セグメント。

1顧客あたり100を超えるセグメントを同期する場合は、以下にお問い合わせください Epsilon。顧客あたりのセグメント数が100を超えると、広告リクエストのセグメントプールが縮小し、リクエスト内のセグメントが切り捨てられる可能性があります。
{% endhint %}

### API同期連携

APIで顧客とセグメントを同期する場合、完了すべき操作が3つあります。

1. セグメントの作成
2. オプション: セグメントアクセスの管理
3. 顧客の作成
4. 顧客とセグメントの紐付け管理

#### APIによるセグメントの作成

最初に行う必要があるのは、顧客を紐付けるためのセグメントの作成です。

UIに表示されるセグメントID、名前、説明、およびリテールメディア事業者のチームを提供する必要があります。

{% hint style="info" %}
重要: セグメントAPIはPartner APIで使用されるベアラー認証を使用します。ベアラートークンを生成して使用する必要があります。詳細: [認証リクエスト](https://help.citrusad.com/retail-media-interface/partner/ja/partner-api-authentication/authenticating-requests).
{% endhint %}

```http
POST $BASE_URL/v1/segments HTTP/1.1
accept: application/json
content-type: application/json
Authorization: Bearer <API_KEY>
{
  "segment":{
        "segmentId": "general-segment-4",
        "sourceId": "DEFAULT_SOURCE_ID",
        "name": "Value Shoppers",
        "description": "Shoppers that have a higher basket % of value driven products.",
        "retailerTeamId": "13c84def-41cb-4f99-a3fc-6788264f79fe"
  }
}
```

「セグメントの作成」エンドポイントのリファレンスを表示 [こちら](https://help.citrusad.com/retail-media-interface/partner/ja/audience-segment-api/segment/createsegment).

#### オプション: セグメントアクセスの管理

manage-access機能を使用すると、選択した広告主にセグメントの閲覧アクセス権を付与でき、特定の広告主向けにセグメントをキュレートできます。

```http
POST $BASE_URL/v1/segments/{id}:manage-access HTTP/1.1
accept: application/json
content-type: application/json
Authorization: Bearer <API_KEY>
{
  "accessTeamIds":[
        "90d5f138-2090-412b-a397-1f59ea6a31b3","1439f6f2-8c43-4ec5-b511-fc153f7d8119"
        ]
}
```

「特定セグメントへのアクセス管理」エンドポイントのリファレンスを表示 [こちら](https://help.citrusad.com/retail-media-interface/partner/ja/audience-segment-api/segment/manageaccess).

#### APIによる顧客の作成

{% hint style="info" %}
顧客APIはIntegration APIで使用される基本認証を使用します。
{% endhint %}

```http
POST $BASE_URL/v1/customers HTTP/1.1
accept: application/json
content-type: application/json
Authorization: Basic <API_KEY>
{
    "customers": [
        {
            "id": "cust_12345"
        },
        {
            "id": "cust_67890"
        }
        }
    ]
}
```

完了したら、顧客を紐付けるセグメントも作成する必要があります。1リクエストにつき最大100人の顧客を作成できます。

「顧客の作成または更新」APIの仕様を表示 [こちら](/retail-media-interface/integration/ja/integration/create-or-update-a-customer.md).

#### APIによる顧客とセグメントの紐付け

セグメントを作成した後、/customers/manage-segments APIを使用して顧客をセグメントに紐付けます

```http
POST $BASE_URL/v1/customers/manage-segments HTTP/1.1
accept: application/json
content-type: application/json
Authorization: Basic <API_KEY>
{
    "customerId": "cust_12345",
    "teamId":"13c84def-41cb-4f99-a3fc-6788264f79fe",
    "segments": {
        "segmentIds":[
        "general-segment-4","general-segment-3"
        ]
    }
}
```

{% hint style="info" %}
このリクエストのteamIdは、お客様のリテールメディア事業者チームIDです。
{% endhint %}

セグメントと顧客を管理するための API の仕様については、こちらをご覧ください。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.citrusad.com/retail-media-interface/integration/ja/data-api/audience-targeting-new/integration-option-2-sync-customers-audience.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
