This section explains how Metica’s integration works alongside your game’s ad logic, and how to handle holdout users correctly.
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.
Code Sample
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.
/// <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();
}