> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/reactor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/reactor/api-reference/ks.unity.editor/ks.unity.editor.ksanalytics.md).

# Class ksAnalytics

Namespace: [KS.Unity.Editor](/reactor/api-reference/ks.unity.editor.md)\
Assembly: KSUnity-Editor.dll

Class for sending analytics events. This is intended for internal use only.

```csharp
public class ksAnalytics
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← [ksAnalytics](/reactor/api-reference/ks.unity.editor/ks.unity.editor.ksanalytics.md)

#### Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)), [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)), [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Constructors

### ksAnalytics(string, string) <a href="#ks_unity_editor_ksanalytics__ctor_system_string_system_string" id="ks_unity_editor_ksanalytics__ctor_system_string_system_string"></a>

Constructor

```csharp
public ksAnalytics(string token, string version)
```

#### Parameters

`token` [string](https://learn.microsoft.com/dotnet/api/system.string)

Token to identify the MixPanel project.

`version` [string](https://learn.microsoft.com/dotnet/api/system.string)

Version sting to send with event data.

## Properties

### Enabled <a href="#ks_unity_editor_ksanalytics_enabled" id="ks_unity_editor_ksanalytics_enabled"></a>

Is analytics enabled?

```csharp
public static bool Enabled { get; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

## Methods

### Get() <a href="#ks_unity_editor_ksanalytics_get" id="ks_unity_editor_ksanalytics_get"></a>

Gets the analytics instance configured for the Reactor analytics project.

```csharp
public static ksAnalytics Get()
```

#### Returns

[ksAnalytics](/reactor/api-reference/ks.unity.editor/ks.unity.editor.ksanalytics.md)

### Initialize(ksVersion) <a href="#ks_unity_editor_ksanalytics_initialize_ks_reactor_client_ksversion" id="ks_unity_editor_ksanalytics_initialize_ks_reactor_client_ksversion"></a>

Initializes the Reactor analytics instance.

```csharp
public static void Initialize(ksVersion version)
```

#### Parameters

`version` [ksVersion](/reactor/api-reference/ks.reactor.client/ks.reactor.client.ksversion.md)

Reactor version

### TrackDailyEvent(ksAnalyticsEvent) <a href="#ks_unity_editor_ksanalytics_trackdailyevent_ks_unity_editor_ksanalyticsevent" id="ks_unity_editor_ksanalytics_trackdailyevent_ks_unity_editor_ksanalyticsevent"></a>

Adds an event to be tracked with analytics if this is the first time an event with this name was tracked today using this function. The next day starts at midnight utc time.

```csharp
public void TrackDailyEvent(ksAnalyticsEvent ev)
```

#### Parameters

`ev` [ksAnalyticsEvent](/reactor/api-reference/ks.unity.editor/ks.unity.editor.ksanalyticsevent.md)

### TrackEvent(ksAnalyticsEvent) <a href="#ks_unity_editor_ksanalytics_trackevent_ks_unity_editor_ksanalyticsevent" id="ks_unity_editor_ksanalytics_trackevent_ks_unity_editor_ksanalyticsevent"></a>

Adds an event to be tracked with analytics.

```csharp
public void TrackEvent(ksAnalyticsEvent ev)
```

#### Parameters

`ev` [ksAnalyticsEvent](/reactor/api-reference/ks.unity.editor/ks.unity.editor.ksanalyticsevent.md)

Analytics event
