# Managing Holdout Users

### Understanding Holdout Users

A holdout is a user who does not receive Metica-optimized ads. Instead, they continue to see ads through your game’s default AppLovin MAX setup. Holdout users are selected randomly and represent a small percentage of your audience.

### Why Holdouts Are Important

Holdout users play a critical role in both measuring performance and improving system accuracy:

#### **Measure Performance Uplift**

Holdout users act as a control group. By comparing their results to those receiving Metica’s optimizations, you can clearly see the added value Metica brings to your ad monetization.

#### Improve Learning and Optimization

By analyzing data from both holdout and optimized users, Metica is able to refine its models more quickly. This leads to better predictions, stronger default strategies, and improved results, especially during early rollout phases or when onboarding new games.

#### What You Need to Do

During initialization, your game will receive a flag:

IsMeticaAdsEnabled = true means use Metica’s logic.

IsMeticaAdsEnabled = false means the user is in holdout and should get your standard MAX ad flow.

Handling this correctly ensures accurate testing, better results, and faster learning.

<figure><img src="https://docs.metica.com/~gitbook/image?url=https%3A%2F%2F2594492910-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FHimctsSfODP3WqmgRoOH%252Fuploads%252FZQkOZiDkNIXDQEaDHZi3%252FAB_testing_flowchart.png%3Falt%3Dmedia%26token%3D4a1dd033-0510-478d-ba1a-ef728fb4d5e8&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=78cc9dea&#x26;sv=2" alt=""><figcaption></figcaption></figure>

## Code Sample <a href="#initialization" id="initialization"></a>

The `IsMeticaAdsEnabled` flag is a boolean variable that determines whether a specific user will receive ads optimized by Metica's AI or will be part of a holdout group receiving ads directly through the standard AppLovin MAX SDK. This flag is set during the SDK initialization and is used to A/B test the revenue performance of Metica's ad optimization against the baseline performance of the MAX SDK.

**Important: `MeticaAds.InitializeAsync()` must be called BEFORE initializing the AppLovin MAX SDK to ensure proper integration.**

Copy

```csharp
/// <summary>
/// Complete initialization flow for MeticaAds and MAX SDK integration
/// This method demonstrates the proper order and setup required for ad functionality
/// Call this method early in your app lifecycle, typically in Start() or Awake()
/// </summary>
public async void InitializeAds()
{
    // Step 1: Set User Identification (Critical Requirement)
    // Important: UserId must be set for the current user before any MeticaAds initialization
    // This unique identifier is used for:
    // - User analytics and behavior tracking
    // - A/B testing and holdout group management
    // - Revenue attribution and reporting
    // - Personalized ad targeting and optimization
    MeticaSdk.CurrentUserId = "your_unique_user_id";

    // Step 2: Configure MeticaAds initialization
    // Create the configuration object that will be passed to the MeticaAds SDK
    var meticaConfiguration = new MeticaConfiguration();
    
    // Step 3: Initialize MeticaAds SDK (Asynchronous Operation)
    // This call performs the core MeticaAds setup including:
    // - SDK authentication and configuration validation
    // - Network connectivity and endpoint verification  
    // - Platform-specific delegate initialization
    // - Ad callback registration and event system setup
    // Returns true if Metica should be used, false otherwise
    IsMeticaAdsEnabled = await MeticaAds.InitializeAsync(meticaConfiguration);

    // Step 4: Initialize AppLovin MAX SDK (Traditional Synchronous Setup)
    // Set the SDK key that identifies your app in the AppLovin dashboard
    // This key is essential for ad serving, reporting, and revenue tracking
    MaxSdk.SetSdkKey("YOUR_MAX_SDK_KEY"); // Replace with your actual MAX SDK key
    
    // Set MAX initialization callback
    MaxSdkCallbacks.OnSdkInitializedEvent += sdkConfiguration =>
    {
        // AppLovin SDK is initialized, now start loading ads
        Debug.Log("MAX SDK Initialized");

        InitializeInterstitialAds();
        InitializeRewardedAds();
    };
    
    // Initialize the MAX SDK - this sets up the underlying ad infrastructure
    // Must be called after MeticaAds initialization to ensure proper integration
    MaxSdk.InitializeSdk();
}
```


---

# Agent Instructions: 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:

```
GET https://docs.metica.com/get-started/unity-sdk/managing-holdout-users.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
