> 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/advanced-initialization-options.md).

# Advanced Initialization Options

The following code examples describe how to configure advanced initialization options when you initialize the FairBid SDK for different use cases, such as enabling logs for debugging, disabling auto-requesting for ads or the collection and transmission of AAID, and flagging certain users as children.

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

```kotlin
FairBid.configureForAppId("your_app_id")
    .enableLogs()              // Enables logs for debugging
    .disableAutoRequesting()   // Disables auto-requesting of ads
    .disableAdvertisingId()    // Disables collection and transmission of AAID
    .setUserAChild()           // Flags certain users as children
    .start(context)
```

{% endcode %}

{% code title="Java" %}

```java
FairBid.configureForAppId("your_app_id")
    .enableLogs()              // Enable logs for debugging
    .disableAutoRequesting()   // Disable auto-requesting of ads
    .disableAdvertisingId()    // Disable collection and transmission of AAID
    .setUserAChild()           // Flag certain users as children
    .start(context);
```

{% endcode %}
{% endtab %}

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

```swift
let options = FYBStartOptions()
options.logLevel = .verbose
options.autoRequestingEnabled = false
options.isChild = true
FairBid.start(withAppId: "1234", options: options)
```

{% endcode %}

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

```objective-c
#import

FYBStartOptions *options = [[FYBStartOptions alloc] init];
options.logLevel = FYBLoggingLevelVerbose;
options.autoRequestingEnabled = NO;
options.isChild = YES;
[FairBid startWithAppId:@"1234" options:options];
```

{% endcode %}
{% endtab %}

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

```csharp
FairBid.ConfigureForAppId("your_app_id")
       .EnableLogs()
       .DisableAutoRequesting()
       .DisableAdvertisingId()
       .SetIsChild(true)
       .Start();
```

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

## App ID

In the initialization code above, you must replace the `your_app_id` value with your `App ID` and pass it as a string. To locate the DT App ID, log in to the [DT Console](https://console.fyber.com/login), and go to **Monetization→App Management**. The **Apps dashboard** displays a list of your apps, and App IDs display below each app name.

## Setting User as Child

This API enables publishers to flag certain users as children. The term children refers to individuals under a certain age, as defined under applicable data privacy laws. This API must be called before SDK initialization. For more information about flagging users as children, see [Flag End-Users as a Child](/dt-fairbid/privacy/flag-end-user-as-a-child.md).

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

```java
setUserAChild
```

{% endcode %}
{% endtab %}

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

```swift
isChild
```

{% endcode %}
{% endtab %}

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

```csharp
setIsChild
```

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

## Setting User Consent for Personalized Ads <a href="#h_01kfh5tgywkfhyepg5rt65mef1" id="h_01kfh5tgywkfhyepg5rt65mef1"></a>

This API allows publishers to indicate consent for delivering personalized ads from DT Exchange to specific mediated networks.

The usage of this API has the following effects:

* The consent information is forwarded to the mediated networks using their API. For more information, see the mediated networks that support this API below.
* The Google Advertising ID (GAID) is sent as a string of zeros when the FairBid auction request is performed.

By default, the FairBid SDK assumes consent is given.

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

```java
/**  @param isConsentGiven   `true` if user gives the consent, `false` otherwise
*  @param context          application or activity context
*/
UserInfo.setPersonalizedAdsConsent(isConsentGiven, context)
```

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

The following mediated networks support this API:

* **Meta Audience Network**: If the consent was rejected prior to FairBid start, the Meta adapter and the SDK do not initialize. If the consent was rejected after FairBid starts, Meta adapter is prevented from performing ad requests in the current session. If the consent was granted, there is no change in the adapter behavior.
* **Pangle**: Pangle SDK’s API for Personalized Advertising is called: `PAGConfig.setPAConsent(paConsent)`


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.digitalturbine.com/dt-fairbid/fairbid-sdk/sdk-reference/advanced-initialization-options.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
