StageUp
Mobile SDKPromotion

Unity Promotion

With the AdStage Unity SDK, you can fetch user-targeted promotions and display them with UI.

1. Get promotion list: getAdStagePromotionList

The following example includes all parameters. You can pass only what you need.

// Example: Calling PromotionList with all parameters
NBaseSDK.NBase.getAdStagePromotionList(
    bannerType: "popup",                 // Banner type: popup, banner, interstitial
    targetAudience: "new_users",         // Target audience
    deviceType: "mobile",                // Device type: mobile, tablet, desktop
    region: "KR",                        // Region code
    limit: 10,                            // Max number of items
    status: "active",                    // Status: active, inactive
    partner: "google",                   // Partner ID
    primaryInterest: "rpg",              // Primary interest
    primaryAgeGroup: "20-30",            // Primary age group
    gameGenrePreference: "action",       // Game genre preference
    playerSpendingTier: "high",          // Spending tier
    playTimePattern: "evening",          // Playtime pattern
    completionHandler: (promotionList, error) =>
    {
        if (error != null)
        {
            Debug.LogError($"Failed to get promotion list: {error.message}");
            return;
        }
 
        Debug.Log($"Total promotions: {promotionList.totalItems}");
 
        foreach (var promotion in promotionList.items)
        {
            Debug.Log($"Promotion ID: {promotion.id}");
            Debug.Log($"Title: {promotion.title}");
            Debug.Log($"Description: {promotion.description}");
            Debug.Log($"Banner URL: {promotion.bannerUrl}");
        }
    }
);

2. Open a promotion: openAdStagePromotion

Open a promotion that matches the given conditions and display it immediately to the user.

// Example: Open a promotion
NBaseSDK.NBase.openAdStagePromotion(
    promotionId: "promo_12345",          // Specific promotion ID (optional)
    bannerType: "popup",                 // Banner type
    targetAudience: "returning_users",   // Target audience
    deviceType: "mobile",                // Device type
    region: "KR",                        // Region code
    partner: "facebook",                 // Partner ID
    primaryInterest: "strategy",         // Primary interest
    primaryAgeGroup: "25-35",            // Primary age group
    gameGenrePreference: "strategy",     // Game genre preference
    playerSpendingTier: "medium",        // Spending tier
    playTimePattern: "weekend",          // Playtime pattern
    showTodayButton: true,                // Show "Do not show today" button
    completionHandler: (success, error) =>
    {
        if (error != null)
        {
            Debug.LogError($"Failed to open promotion: {error.message}");
            return;
        }
 
        if (success)
        {
            Debug.Log("Promotion opened successfully");
        }
        else
        {
            Debug.Log("No matching promotion found");
        }
    }
);

3. Notes

  • All parameters are optional; when null/omitted, the query uses broad defaults.
  • getAdStagePromotionList is for data retrieval only, while openAdStagePromotion includes UI rendering.
  • Initialize the SDK at app startup and ensure lifecycle callbacks are placed correctly.

Table of Contents