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

# イベントのトラッキング

> MoEngage の TrackEvent API を使用して、Unity アプリでカスタムユーザーイベントとそのプロパティをトラッキングします。

<Info>
  SDK は MoEngage の FUP ポリシーに準拠しています。詳細については、[フェアユースポリシー](https://www.moengage.com/docs/user-guide/data/key-concepts/fair-usage-policy-fup) を参照してください。
</Info>

イベントのトラッキングとは、ユーザーが実行したアクションを、そのアクションを説明するプロパティとともに記録することです。trackEvent を 1 回呼び出すごとに、1 つのユーザーアクションが記録されます。チームの誰もがすぐに意味を理解できるように、イベント名は人間が読める形式にすることをお勧めします。

**TrackEvent()** の呼び出しでは、イベント名と、イベントに関する追加のイベント属性を表す **Properties** インスタンスの 2 つのパラメーターが必要です。キャンペーン作成時のセグメンテーションに役立つと思われる追加情報をすべて追加してください。たとえば、次の例は、使用可能なすべてのデータ型でイベントをトラッキングする例を示しています。

<CodeGroup>
  ```c# c# theme={null}
  // Create Properties instance with all the event attributes info
  Properties properties = new Properties()
                .AddBoolean("booleanAttr", true)
                .AddDouble("doubleAttr", 12.34)
                .AddInteger("intAttr", 123)
                .AddLocation("locationAttr", new GeoLocation(12.21, 13.42))
                .AddISODateTime("dateAttr", "2019-01-02T08:26:21.170Z")
                .AddString("stringAttr", "test String");

  // Track Event to track the Event
  MoEngageClient.TrackEvent("UnityEvent", properties);
  ```
</CodeGroup>

<Warning>
  イベント名には、"\_" 以外の特殊文字を含めないでください。使用できるのはスペースとアンダースコアのみです。
</Warning>

# 分析

MoEngage SDK は、ユーザーセッションとアプリケーションのトラフィックソースのトラッキングを開始しました。
ユーザーセッションとアプリケーションのトラフィックソースのトラッキングの仕組みの詳細については、次のドキュメントを参照してください。

* [セッションとソースの分析](https://www.moengage.com/docs/user-guide/analyze/analytics/session-and-source/session-and-source-analysis)
* [高度なセッションとソースの分析](https://www.moengage.com/docs/user-guide/analyze/analytics/session-and-source/advanced-session-and-source-analysis)

ユーザーセッションのトラッキングに伴い、イベントを選択的に非インタラクティブとしてマークできる柔軟性が導入されました。

## 非インタラクティブイベントとは

セッションの計算にまったく影響しないイベントを、非インタラクティブイベントと呼びます。非インタラクティブイベントには次の特性があります。

* 新しいセッションを開始しません。
* セッションを延長しません。
* ユーザーセッションに関連する情報を持ちません。

## イベントを非インタラクティブとしてマークする方法

イベントを非インタラクティブとしてマークするには、以下に示すように **Properties** インスタンスに対して **SetNonInteractiveEvent()** を呼び出します。

<CodeGroup>
  ```c# c# theme={null}
  // Create Properties instance with SetNonInteractive()
  Properties properties = new Properties()
                .AddBoolean("booleanAttr", true)
                .AddString("stringAttr", "test String")
                .SetNonInteractive();

  // Track Event to track the Event
  MoEngageClient.TrackEvent("NonInteractive Event", properties);
  ```
</CodeGroup>
