# Capturing Context In Key Moments

Our SDK provides event tracking APIs to capture user interactions within your app, enabling insights into usage across real-world contexts.

Logging these events is optional and for informational purposes only. It will not influence your app's behavior.

### Page Views

Track when users navigate between different screens. This data helps you understand which screens users interact with most frequently in various real-world contexts.

{% tabs %}
{% tab title="Swift" %}

```swift
ContextManager.trackPageView("page_identifier")
```

{% endtab %}

{% tab title="Android" %}

```kotlin
ContextSDK.trackPageView("page_identifier");
```

{% endtab %}

{% tab title="Flutter" %}

```dart
_contextSdkPlugin.trackPageView("page_identifier");
```

{% endtab %}

{% tab title="Unity" %}

```csharp
ContextSDKBinding.TrackPageView("page_identifier");
```

{% endtab %}

{% tab title="React Native" %}

```javascript
import { trackPageView } from 'react-native-context-sdk';

trackPageView("page_identifier");
```

{% endtab %}
{% endtabs %}

### User Actions

Record specific user actions, such as enabling a feature, tapping buttons, creating accounts, or sharing content. Capturing these events helps you gain insights into how user interactions correlate with different real-world scenarios.

{% tabs %}
{% tab title="Swift" %}

```swift
ContextManager.trackUserAction("user_tapped_share_button")
```

{% endtab %}

{% tab title="Android" %}

```kotlin
ContextSDK.trackUserAction("user_tapped_share_button");
```

{% endtab %}

{% tab title="Flutter" %}

```dart
_contextSdkPlugin.trackUserAction("user_tapped_share_button");
```

{% endtab %}

{% tab title="Unity" %}

```csharp
ContextSDKBinding.TrackUserAction("user_tapped_share_button");
```

{% endtab %}

{% tab title="React Native" %}

```javascript
import { trackUserAction } from 'react-native-context-sdk';

trackUserAction("user_tapped_share_button");
```

{% endtab %}
{% endtabs %}

### Generic Events

Track custom events that don't fall under the other categories. Alternatively, add this to your existing analytics code to easily log all your existing events into ContextSDK, allowing us to provide you insights without much effort.

{% tabs %}
{% tab title="Swift" %}

```swift
ContextManager.trackEvent("custom_event")
```

{% endtab %}

{% tab title="Android" %}

```kotlin
ContextSDK.trackEvent("custom_event");
```

{% endtab %}

{% tab title="Flutter" %}

```dart
_contextSdkPlugin.trackEvent("custom_event");
```

{% endtab %}

{% tab title="Unity" %}

```csharp
ContextSDKBinding.TrackEvent("custom_event");
```

{% endtab %}

{% tab title="React Native" %}

```javascript
import { trackEvent } from 'react-native-context-sdk';

trackEvent("custom_event");
```

{% endtab %}
{% endtabs %}
