# Privacy & consent

> Gate the Grovs Unity SDK on player consent, and see what it collects.

Source: https://docs.grovs.io/docs/sdk/unity/privacy

## Gating collection on consent

A disabled SDK collects nothing. The native SDK starts before Unity, so the first-launch state comes from Project Settings, not from C#.

1. Turn off **Start enabled** in **Project Settings → Grovs**. Grovs then does nothing on first launch.
2. When the player agrees:
   ```csharp
   Grovs.SetEnabled(true);
   ```
   Grovs starts, and the link that opened the game, if any, is delivered to `DeeplinkReceived`.
3. To withdraw consent:
   ```csharp
   Grovs.SetEnabled(false);
   ```

Unlike the native SDKs, the choice **is saved** on the device and used on every later launch, before Unity starts. A saved choice always wins over **Start enabled**. Read the current state with `Grovs.IsEnabled`.

| Platform | Where the choice is stored                            |
| -------- | ----------------------------------------------------- |
| iOS      | `UserDefaults`, key `grovs_unity_enabled`             |
| Android  | `SharedPreferences` file `grovs_unity`, key `enabled` |

`IsEnabled` is `false` until the native SDK has started, and always `false` in the Editor.

### While the SDK is disabled

- `HandleUrl` returns `false`.
- `GenerateLinkAsync`, `GetLinkDetailsAsync`, `LogInAppPurchaseAsync` and `LogCustomPurchaseAsync` fail with `SdkDisabled`.
- Other calls go to the native SDK, which holds or drops them as it does natively: see [iOS](https://docs.grovs.io/docs/sdk/ios/privacy#while-the-sdk-is-disabled) and [Android](https://docs.grovs.io/docs/sdk/android/privacy#while-the-sdk-is-disabled).

## What the SDK collects

The package adds nothing of its own. Collection is done by the native SDKs:

- [What the iOS SDK collects](https://docs.grovs.io/docs/sdk/ios/privacy#what-the-sdk-collects), and its [privacy manifest](https://docs.grovs.io/docs/sdk/ios/privacy#privacy-manifest), which the `Grovs` pod ships
- [What the Android SDK collects](https://docs.grovs.io/docs/sdk/android/privacy#what-the-sdk-collects), and the [Google Play data safety](https://docs.grovs.io/docs/sdk/android/privacy#google-play-data-safety) answers

The clipboard is read only for [clipboard-assisted deferred deep linking](https://docs.grovs.io/docs/sdk/unity/deep-linking#clipboard-assisted-deferred-deep-linking), and only links on Grovs hosts or your **Clipboard domains** are sent.

Anything you put in `SetUserAttributes` or event properties, an email or a name say, is data you collect too and needs its own declaration in App Store Connect and Google Play.

## Logs

The default native log level is **Error**. Change it in Project Settings or at runtime:

```csharp
Grovs.SetLogLevel(GrovsLogLevel.Info);
```

Android has no warn level, so `Warn` logs at `Info` there. The C# layer logs warnings and errors to the Unity console with a `[Grovs]` prefix.
