> For the complete documentation index, see [llms.txt](https://docs.nubrick.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nubrick.app/other/eventguide.md).

# イベント設計ガイド

## イベントの用途、メリット

Nubrickにおける「イベント」や「ユーザープロパティ」は、アプリ内施策（エクスペリメント）を適切なユーザー・タイミングで配信し、その効果を正確に測定するために不可欠なデータです。

適切に設計・実装することで、以下の3つのメリット・用途を実現できます。

1. **エクスペリメント配信時の対象ユーザー指定（ターゲティング）**
   * ユーザー属性や行動状態に応じて配信対象を絞り込む（例: 有料会員のみ、特定バージョンのユーザーのみなど）ことができます。
2. **モーダル施策（In-App Messaging）のトリガー指定**
   * ユーザーが特定の画面を開いた瞬間や、特定のアクションを起こしたタイミングでモーダルをリアルタイム表示できます。
3. **効果測定時の「ゴール（コンバージョン）」計測**
   * 施策（A/Bテスト等）を表示した結果、ユーザーが目的のアクション（購入完了、会員登録など）に至ったかをKPIとして評価・計測できます。

## デフォルトで指定できるイベントとユーザープロパティ

以下を参照してください

{% content-ref url="/pages/sfDI88CIvPPIXSDfoWbk" %}
[トリガー](/experiment_edior/trigger.md)
{% endcontent-ref %}

{% content-ref url="/pages/mGBQ8EVGYmbHtvSLGX0l" %}
[対象ユーザー](/experiment_edior/user.md)
{% endcontent-ref %}

## カスタムイベント・ユーザープロパティの3つの推奨設定

Nubrickの成果を最大化するために、以下**3つの区分での設定を推奨**しています。

#### 1. Viewイベント系（ページの閲覧をイベント化）

* **概要**
  * アプリ内の特定の画面（ページ）が表示されたタイミングで発火させるイベントです。
* **主な用途**
  * **モーダル施策のトリガー**: 特定の画面（例: カート画面、マイページなど）を開いた瞬間にクーポンや案内を表示する。
  * **ゴールの設定**: 施策を通して特定のページ（例: 注文完了画面、キャンペーン詳細画面）に到達したかを計測する。
* **実装・設計イメージ**
  * `VIEW_HOME`（ホーム画面表示）
  * `VIEW_CART`（カート画面表示）
  * `VIEW_THANK_YOU`（購入完了画面表示）

#### 2. その他イベント（ページ遷移を伴わないアクション）

* **概要**
  * ボタンタップ、機能の実行、状態の変化など、画面遷移を伴わないユーザー行動を追跡するイベントです。
* **主な用途**
  * **モーダル施策のトリガー**: 特定の操作（例: お気に入り登録、検索実行）をトリガーにして関連モーダルを即座に表示する。
  * **ゴールの設定**: 特定の機能利用やタップアクション（例: クーポン適用ボタンタップ、動画再生完了）を成果ゴールとして評価する。
* **実装・設計イメージ**
  * `TAP_FAVORITE_BUTTON`（お気に入りボタンのタップ）
  * `EXECUTE_SEARCH`（検索の実行）
  * `COMPLETE_PURCHASE`（購入アクションの完了）

#### 3. setProperties（ユーザー情報の設定）

* **概要**
  * イベント（点のアクション）ではなく、ユーザー個々の属性・状態（線の属性）をNubrickSDKに渡す設定です。
* **主な用途**
  * **配信ユーザーのセグメント（フィルタリング）：**「会員ランク」「課金有無」「登録日」などの条件を設定し、エクスペリメントの対象ユーザーを精密に絞り込むことができます。
  * **動的な変数表示：**&#x30E2;ーダルや埋め込み画面内で、ユーザー名や保有ポイント数などを動的にテキスト表示する際にも利用可能です。
* **実装・設計イメージ**
  * `setProperties({"user_type": "premium", "points": 1500})`
* 詳細リファレンス

{% content-ref url="/pages/g8D2PUVjC0sX5zBV9zoJ" %}
[ユーザー属性情報（setProperties）について](/other/setproperties.md)
{% endcontent-ref %}

## SDKでの実装について

以下各種リファレンスをご確認ください。

#### iOS

{% content-ref url="/pages/KoDSlChpdeCMjC1eTTgB" %}
[Events](/reference/ios/events.md)
{% endcontent-ref %}

{% content-ref url="/pages/MWjwHxmZyDjHWCoEPTrg" %}
[NubrickSDK](/reference/ios/nubricksdk.md)
{% endcontent-ref %}

#### Android

{% content-ref url="/pages/m8tZWgMTNTAJtpE62g8J" %}
[Events](/reference/android/events.md)
{% endcontent-ref %}

{% content-ref url="/pages/wEGc5WSWF6XTtdWSFi5e" %}
[NubrickSDK](/reference/android/nubricksdk.md)
{% endcontent-ref %}

#### Flutter

{% content-ref url="/pages/fN54DvJPOPI5cXeXTLlZ" %}
[NubrickDispatcher](/reference/flutter/nubrickdispatcher.md)
{% endcontent-ref %}

{% content-ref url="/pages/Y2mwHuEX6UfVu1bueF2n" %}
[NubrickUser](/reference/flutter/nubrickuser.md)
{% endcontent-ref %}

#### setProperties

{% content-ref url="/pages/g8D2PUVjC0sX5zBV9zoJ" %}
[ユーザー属性情報（setProperties）について](/other/setproperties.md)
{% endcontent-ref %}


---

# 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://docs.nubrick.app/other/eventguide.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.
