> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# プレイヤー セグメンテーション

> Game Manager で統計、タグ、通貨に基づいて PlayFab プレイヤー セグメントを定義し、プレイヤーがセグメントに入ったときに CloudScript アクションをトリガーします。

プレイヤー セグメンテーションは [Game Manager](/services/playfab/live-service-management/gamemanager/quickstart) で定義されます。セグメントを使用すると、有用または興味深いプレイヤー グループを定義し、そのグループに対して排他的なアクションを実行できます。

## 要件

* PlayFab に定義された、特徴のあるプレイヤーとないプレイヤー。

* 定義された [CloudScript PlayStream フック](/services/playfab/data-analytics/acting-data/action-rules-using-cloudscript-actions-with-playstream)。

### 例のケース: ゲーム内目標に達したすべてのプレイヤーに対してカスタム CloudScript を実行する

プレイヤーの *定義特性* には、次のようなものが考えられます:

* ログイン時刻
* リンクされたデバイス タイプ
* タグ
* 実世界の場所
* 統計値
* 仮想通貨の値
* 実マネーの購入など

この例では、私たちの特徴的な特性は統計 - 具体的には **50 str** を達成したプレイヤーです。

<Note>
  統計は多くの可能なオプションの 1 つで、この例に特に必要なだけです。統計要件を、お好みの別のフィルターに自由に置き換えてください。
</Note>

私たちのアクションは CloudScript 関数の実行です。CloudScript は圧倒的に最も柔軟なトリガー オプションで、セグメント遷移時のプレイヤーとセグメント化情報の完全な制御を提供します。

**Game Manager** 画面から:

* **Title** に移動します。
* 左側のメニューから **Players** を選択します。
* **Segments** タブに移動します。
* **New Segment** を選択します。

以下に示す画面は、上記の **Segment** の例です。

<img src="https://mintcdn.com/microsoft-4404708b/IwSYTY5BEqd_x-HK/images/playfab/data-analytics/acting-data/tutorials/game-manager-players-segments-new-segment.png?fit=max&auto=format&n=IwSYTY5BEqd_x-HK&q=85&s=816790fcff260f025fe164429652ba7f" alt="Game Manager - players - segments - 新しいセグメント" width="1280" height="720" data-path="images/playfab/data-analytics/acting-data/tutorials/game-manager-players-segments-new-segment.png" />

この例で最も複雑な部分は CloudScript です。[CloudScript ハンドラー](/services/playfab/data-analytics/acting-data/action-rules-using-cloudscript-actions-with-playstream) の 2 番目のパラメーター、*Context* を使用して、プレイヤーとセグメント遷移を特定します。

その後、[インベントリ アイテム](/services/playfab/player-progression/player-data/player-inventory)、[仮想通貨](/services/playfab/economy-monetization/economy-v2/tutorials/currencies)、[プレイヤー データ](/services/playfab/player-progression/player-data/quickstart)、[統計](/services/playfab/community/leaderboards/tournaments-leaderboards/using-player-statistics) の付与など、プレイヤーに対して任意のアクションを実行します。

関連項目: [ストア セグメンテーションのベスト プラクティス](/services/playfab/economy-monetization/economy-v2/overview)


## Related topics

- [セグメンテーション](/ja-jp/services/playfab/live-service-management/game-configuration/segmentation/segmentation-overview.md)
- [PlayFab ライブ サービス管理ドキュメント](/ja-jp/services/playfab/live-service-management/index.md)
- [Economy (Legacy) のプレイヤー セグメント向けカスタム ストア](/ja-jp/services/playfab/economy-monetization/economy/tutorials/custom-stores-for-player-segments.md)
- [Live Service Management の概要](/ja-jp/services/playfab/live-service-management/overview.md)
- [player_action_executed](/ja-jp/services/playfab/api-references/events/Player/player-action-executed.md)
