> For the complete documentation index, see [llms.txt](https://docs.digitalturbine.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digitalturbine.com/dt-fairbid/fairbid-sdk/sdk-reference/ccpa-privacy-string.md).

# CCPA - Privacy String

The California Consumer Privacy Act of 2018 ([CCPA](https://iabtechlab.com/standards/ccpa/)) protects the personal information of California residents. It applies to all businesses operating in California. If a California resident uses an app developer's mobile app, CCPA applies to the developer and all relevant partners that process users' personal information.

## Setting the IAB US Privacy String

DT recommends that the first time you gather a user's opt-out (consent), pass it to the SDK before initializing it. The SDK considers the user's opt-out when initializing.

To set the IAB US privacy string using the following API:

{% tabs %}
{% tab title="Android" %}
{% code title="Java" %}

```java
String privacyString = "1YNN";
UserInfo.setIabUsPrivacyString(privacyString, context);
```

{% endcode %}
{% endtab %}

{% tab title="iOS" %}
{% code title="Swift" %}

```swift
FairBid.user().iabusPrivacyString = "1YNN"
```

{% endcode %}

{% code title="Objective-C" %}

```objective-c
[FairBid user].IABUSPrivacyString = @"1YNN";
```

{% endcode %}
{% endtab %}

{% tab title="Unity" %}
{% code title="C#" %}

```csharp
var privacyString = "1YNN";
    UserInfo.SetIabUsPrivacyString(privacyString);
```

{% endcode %}
{% endtab %}
{% endtabs %}

To determine what value to use for the US Privacy String, see [IAB US Privacy String](https://github.com/InteractiveAdvertisingBureau/USPrivacy/blob/master/CCPA/US%20Privacy%20String.md).

Valid values include:

* `1---`: CCPA does not apply, for example, the user is not a California resident.
* `1YNN`: User does NOT opt out, ad experience continues.
* `1YYN`: User opts out of targeted advertising.

## Clearing Privacy Opt-Out

To clear the user opt-out setting, use the following API:

{% tabs %}
{% tab title="Android" %}
{% code title="Java" %}

```java
UserInfo.clearIabUsPrivacyString(context);
```

{% endcode %}
{% endtab %}

{% tab title="iOS" %}
{% code title="Swift" %}

```swift
FairBid.user().clearIABUSPrivacyString();
```

{% endcode %}

{% code title="Objective-C" %}

```objective-c
[[FairBid user] clearIABUSPrivacyString];
```

{% endcode %}
{% endtab %}

{% tab title="Unity" %}
{% code title="C#" %}

```csharp
UserInfo.ClearIabUsPrivacyString();
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.digitalturbine.com/dt-fairbid/fairbid-sdk/sdk-reference/ccpa-privacy-string.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
