---
title: "Data Collected"
description: "See what data is collected by the Sentry Unity SDK."
url: https://docs.sentry.io/platforms/unity/data-management/data-collected/
---

# Data Collected for Unity

Sentry takes data privacy very seriously and has default settings in place that prioritize data safety, especially when it comes to personally identifiable information (PII) data. When you add the Sentry SDK to your application, you allow it to collect data and send it to Sentry during the runtime of your application.

The data the Sentry Unity SDK collects depends on the options and integrations you enable. Here's a list of data categories it collects:

## [Information About the User](https://docs.sentry.io/platforms/unity/data-management/data-collected.md#information-about-the-user)

The SDK always sends an installation ID as `user.id`. By default, it's a random ID that the SDK stores in a file on the device. On platforms where the SDK can't write files, such as UWP and visionOS, it uses the MAC address of the network adapter or a hash of the machine name instead. On iOS, Android, Nintendo Switch, and macOS with the Cocoa backend, it's the native SDK's installation ID, so C# events and native crashes share the same user.

With [Unity as a Library](https://docs.sentry.io/platforms/unity/native-support/unity-as-a-library.md), the game's events carry the user that the host app sets.

To send your own user information, [identify the user](https://docs.sentry.io/platforms/unity/enriching-events/identify-user.md).

## [Data Sent With SendDefaultPii](https://docs.sentry.io/platforms/unity/data-management/data-collected.md#data-sent-with-senddefaultpii)

If `SendDefaultPii` is set to `true`, the SDK also sends:

* The user's IP address. The SDK sets it to `{{auto}}`, and Sentry fills in the IP address the event came from.
* The device unique identifier (`SystemInfo.deviceUniqueIdentifier`).
* The device's name as `device.name`. On desktop, this is the computer name. Native crashes on Windows, Linux, macOS with the Native backend, and game consoles include it only with this option too. Native crashes on Android, iOS, and macOS with the Cocoa backend don't include a device name.
* The operating system's user name as `user.username`, if **Auto Set UserName** (`IsEnvironmentUser`) is also enabled. Learn more in [Options](https://docs.sentry.io/platforms/unity/configuration/options.md#IsEnvironmentUser).

Error events don't include a server name.

You can [prevent Sentry from storing IP Addresses](https://docs.sentry.io/platforms/unity/enriching-events/identify-user.md#ip_address) either by configuring this in the ["Security & Privacy"](https://sentry.io/orgredirect/organizations/:orgslug/settings/projects/:projectId/security-and-privacy/) settings of your Sentry project or using [server-side data scrubbing](https://docs.sentry.io/security-legal-pii/scrubbing/server-side-scrubbing.md).

## [Failed HTTP Requests](https://docs.sentry.io/platforms/unity/data-management/data-collected.md#failed-http-requests)

On iOS and macOS with the Cocoa backend, the Cocoa SDK captures failed `NSURLSession` requests as native events, with the URL, query string, method, and sanitized headers. These events don't run the C# callbacks. To turn this off, set [`CaptureFailedRequests`](https://docs.sentry.io/platforms/unity/configuration/options.md#CaptureFailedRequests) to `false`.

In C#, the SDK only records HTTP requests sent through `SentryHttpMessageHandler`. For these, it adds `http` breadcrumbs with the URL, and captures failed requests as events with the URL and query string. If `SendDefaultPii` is set to `true`, these events also include the full URL, the headers, and the cookies.

## [General Device Information](https://docs.sentry.io/platforms/unity/data-management/data-collected.md#general-device-information)

The SDK collects information about the app, the operating system, the device, the GPU, the runtime, and Unity, and sends it with every event:

* `app`: the product name, the start time, and whether it's a debug or release build.
* `os`: the operating system description. On Xbox and PlayStation, it's the name of the console.
* `device`: the processor count, CPU, time zone, vibration support, device type, model, and system memory. In the Unity Editor, the device is marked as a simulator.
* `gpu`: the GPU's ID, name, vendor name and ID, memory, graphics API and version, maximum texture size, shader level, multithreaded rendering, and support for non-power-of-two textures, instancing, ray tracing, and compute and geometry shaders.
* `unity`: the Editor version, install mode, target frame rate, copy texture support, and rendering threading mode.
* `runtime`: the .NET runtime the game runs on.
* The current culture and UI culture, and the thread pool's thread counts.

For events captured on the main thread, the SDK also adds:

* The app's allocated memory (`app.memory`).
* The battery status and level, and the device orientation.
* The connection type, on iOS and Android.
* The name of the active scene, in the Unity Editor and in IL2CPP builds.

Every event also records whether it was captured on the main thread (`unity.is_main_thread`).

## [Breadcrumbs](https://docs.sentry.io/platforms/unity/data-management/data-collected.md#breadcrumbs)

The SDK records Unity log messages, scene changes, and app lifecycle events as breadcrumbs, and sends them with events. Log messages can contain PII, depending on what your game logs. Learn more in [Breadcrumbs](https://docs.sentry.io/platforms/unity/enriching-events/breadcrumbs.md).

## [Logs](https://docs.sentry.io/platforms/unity/data-management/data-collected.md#logs)

Unity log messages that the SDK forwards to Sentry Logs can contain PII, depending on what your game logs. Each log carries the user from the scope as attributes. If `SendDefaultPii` is set to `true`, each log also carries the machine name as `server.address`. Learn more in [Logs](https://docs.sentry.io/platforms/unity/logs.md).

## [Screenshots and View Hierarchy](https://docs.sentry.io/platforms/unity/data-management/data-collected.md#screenshots-and-view-hierarchy)

Screenshots and the view hierarchy are opt-in. Both can contain PII, such as names shown on screen or in the names of GameObjects. Learn more in [Screenshots](https://docs.sentry.io/platforms/unity/enriching-events/screenshots.md) and [View Hierarchy](https://docs.sentry.io/platforms/unity/enriching-events/view-hierarchy.md).

## [Data captured by Mobile SDKs](https://docs.sentry.io/platforms/unity/data-management/data-collected.md#data-captured-by-mobile-sdks)

On mobile platforms, the Sentry SDK for Unity can also capture data through the Android and iOS SDKs. Refer to the documentation for those SDKs for more information on what data they capture.

* [Android](https://docs.sentry.io/platforms/android/data-management/data-collected.md)
* [iOS](https://docs.sentry.io/platforms/apple/data-management/data-collected.md)

## [Data captured by the Native SDK](https://docs.sentry.io/platforms/unity/data-management/data-collected.md#data-captured-by-the-native-sdk)

When compiling for Windows, Linux or other platforms that use Sentry Native, refer to [data captured by the Native SDK](https://docs.sentry.io/platforms/native/data-management/data-collected.md) to understand what data is sent with those events.
