ইন্টারস্টিশিয়াল বিজ্ঞাপন

Interstitial ads are full-screen ads that cover the interface of their host app. They're typically displayed at natural transition points in the flow of an app, such as during the pause between levels in a game. When an app shows an interstitial ad, the user has the choice to either tap on the ad and continue to its destination or close it and return to the app. Case study .

এই নির্দেশিকাটি ব্যাখ্যা করে কিভাবে একটি ইউনিটি অ্যাপে ইন্টারস্টিশিয়াল বিজ্ঞাপন সংহত করতে হয়।

পূর্বশর্ত

সর্বদা পরীক্ষামূলক বিজ্ঞাপন দিয়ে পরীক্ষা করুন

The following sample code contains an ad unit ID which you can use to request test ads. It's been specially configured to return test ads rather than production ads for every request, making it safe to use.

তবে, AdMob ওয়েব ইন্টারফেসে একটি অ্যাপ নিবন্ধন করার পরে এবং আপনার অ্যাপে ব্যবহারের জন্য নিজস্ব বিজ্ঞাপন ইউনিট আইডি তৈরি করার পরে, ডেভেলপমেন্টের সময় আপনার ডিভাইসটিকে একটি পরীক্ষামূলক ডিভাইস হিসেবে স্পষ্টভাবে কনফিগার করুন

অ্যান্ড্রয়েড

ca-app-pub-3940256099942544/1033173712

আইওএস

ca-app-pub-3940256099942544/4411468910

মোবাইল বিজ্ঞাপন SDK চালু করুন

বিজ্ঞাপন লোড করার আগে, আপনার অ্যাপটিকে MobileAds.Initialize() কল করে Google Mobile Ads Unity Plugin চালু করতে বলুন। এটি শুধুমাত্র একবার করতে হবে, আদর্শভাবে অ্যাপ লঞ্চের সময়।

using GoogleMobileAds;
using GoogleMobileAds.Api;

public class GoogleMobileAdsDemoScript : MonoBehaviour
{
    public void Start()
    {
        // Initialize Google Mobile Ads Unity Plugin.
        MobileAds.Initialize((InitializationStatus initStatus) =>
        {
            // This callback is called once the MobileAds SDK is initialized.
        });
    }
}

যদি আপনি মধ্যস্থতা ব্যবহার করেন, তাহলে বিজ্ঞাপন লোড করার আগে কলব্যাক না হওয়া পর্যন্ত অপেক্ষা করুন কারণ এটি নিশ্চিত করবে যে সমস্ত মধ্যস্থতা অ্যাডাপ্টার শুরু হয়েছে।

ইন্টারস্টিশিয়াল বিজ্ঞাপনটি লোড করুন

Loading an interstitial ad is accomplished using the static Load() method on the InterstitialAd class. The load method requires an ad unit ID, an AdRequest object, and a completion handler which gets called when ad loading succeeds or fails. The loaded InterstitialAd object is provided as a parameter in the completion handler. The following example loads InterstitialAd:

// Create our request used to load the ad.
var adRequest = new AdRequest();

// Send the request to load the ad.
InterstitialAd.Load("AD_UNIT_ID", adRequest, (InterstitialAd ad, LoadAdError error) =>
{
    if (error != null)
    {
        // The ad failed to load.
        return;
    }
    // The ad loaded successfully.
});

AD_UNIT_ID এর পরিবর্তে আপনার বিজ্ঞাপন ইউনিট আইডি দিন।

ইন্টারস্টিশিয়াল বিজ্ঞাপনটি দেখান

লোড করা ইন্টারস্টিশিয়াল বিজ্ঞাপন দেখানোর জন্য, InterstitialAd ইনস্ট্যান্সে Show() পদ্ধতিটি কল করুন। প্রতি লোডে একবার বিজ্ঞাপন দেখানো যেতে পারে। বিজ্ঞাপনটি দেখানোর জন্য প্রস্তুত কিনা তা যাচাই করতে CanShowAd() পদ্ধতিটি ব্যবহার করুন।

if (interstitialAd != null && interstitialAd.CanShowAd())
{
    interstitialAd.Show();
}

ইন্টারস্টিশিয়াল বিজ্ঞাপন ইভেন্টগুলি শুনুন

আপনার বিজ্ঞাপনের আচরণ আরও কাস্টমাইজ করার জন্য, আপনি বিজ্ঞাপনের জীবনচক্রের বেশ কয়েকটি ইভেন্টের সাথে সংযোগ স্থাপন করতে পারেন। নিম্নলিখিত উদাহরণটি বিজ্ঞাপনের ইভেন্টগুলি শোনে:

interstitialAd.OnAdPaid += (AdValue adValue) =>
{
    // Raised when the ad is estimated to have earned money.
};
interstitialAd.OnAdImpressionRecorded += () =>
{
    // Raised when an impression is recorded for an ad.
};
interstitialAd.OnAdClicked += () =>
{
    // Raised when a click is recorded for an ad.
};
interstitialAd.OnAdFullScreenContentOpened += () =>
{
    // Raised when the ad opened full screen content.
};
interstitialAd.OnAdFullScreenContentClosed += () =>
{
    // Raised when the ad closed full screen content.
};
interstitialAd.OnAdFullScreenContentFailed += (AdError error) =>
{
    // Raised when the ad failed to open full screen content.
};

ইন্টারস্টিশিয়াল বিজ্ঞাপনটি পরিষ্কার করুন

InterstitialAd তৈরি শেষ হলে, আপনার রেফারেন্সটি বাদ দেওয়ার আগে Destroy() পদ্ধতিটি কল করতে ভুলবেন না:

if (interstitialAd != null)
{
    interstitialAd.Destroy();
}

এটি প্লাগইনটিকে অবহিত করে যে বস্তুটি আর ব্যবহৃত হচ্ছে না এবং এটি যে মেমরি দখল করে আছে তা পুনরুদ্ধার করা যেতে পারে। এই পদ্ধতিটি কল করতে ব্যর্থ হলে মেমরি লিক হয়।

পরবর্তী ইন্টারস্টিশিয়াল বিজ্ঞাপনটি প্রিলোড করুন

ইন্টারস্টিশিয়াল বিজ্ঞাপনগুলি একবার ব্যবহারের জন্য তৈরি। এর অর্থ হল একবার ইন্টারস্টিশিয়াল বিজ্ঞাপন দেখানো হলে, বস্তুটি আর ব্যবহার করা যাবে না। আরেকটি ইন্টারস্টিশিয়াল বিজ্ঞাপনের অনুরোধ করতে, একটি নতুন InterstitialAd অবজেক্ট তৈরি করুন।

পরবর্তী ইম্প্রেশন সুযোগের জন্য একটি ইন্টারস্টিশিয়াল বিজ্ঞাপন প্রস্তুত করতে, OnAdFullScreenContentClosed বা OnAdFullScreenContentFailed বিজ্ঞাপন ইভেন্টটি উত্থাপিত হওয়ার পরে ইন্টারস্টিশিয়াল বিজ্ঞাপনটি প্রিলোড করুন।

interstitialAd.OnAdFullScreenContentClosed += () =>
{
    // Reload the ad so that we can show another as soon as possible.
    var adRequest = new AdRequest();
    InterstitialAd.Load("AD_UNIT_ID", adRequest, (InterstitialAd ad, LoadAdError error) =>
    {
        // Handle ad loading here.
    });
};

সেরা অনুশীলন

আপনার অ্যাপের জন্য ইন্টারস্টিশিয়াল বিজ্ঞাপনগুলি সঠিক ধরণের বিজ্ঞাপন কিনা তা নির্ধারণ করুন।
Interstitial ads work best in apps with natural transition points. The conclusion of a task within an app, such as sharing an image or completing a game level, creates such a point. Make sure you consider at which points in your app's flow to best display interstitial ads and how the user is likely to respond.
একটি ইন্টারস্টিশিয়াল বিজ্ঞাপন প্রদর্শনের সময় ক্রিয়াটি বিরতি দিন।
টেক্সট, ছবি বা ভিডিওর মতো বিভিন্ন ধরণের ইন্টারস্টিশিয়াল বিজ্ঞাপন রয়েছে। এটি নিশ্চিত করা গুরুত্বপূর্ণ যে যখন আপনার অ্যাপ একটি ইন্টারস্টিশিয়াল বিজ্ঞাপন প্রদর্শন করে, তখন বিজ্ঞাপনটি সেগুলির সুবিধা নেওয়ার জন্য কিছু রিসোর্সের ব্যবহার স্থগিত করে। উদাহরণস্বরূপ, যখন আপনি একটি ইন্টারস্টিশিয়াল বিজ্ঞাপন প্রদর্শনের জন্য কল করেন, তখন আপনার অ্যাপ দ্বারা উৎপাদিত যেকোনো অডিও আউটপুট স্থগিত করতে ভুলবেন না। আপনি OnAdFullScreenContentClosed() ইভেন্টে শব্দ বাজানো পুনরায় শুরু করতে পারেন, যা ব্যবহারকারী বিজ্ঞাপনের সাথে ইন্টারঅ্যাক্ট করা শেষ করার পরে চালু করা যেতে পারে। এছাড়াও, বিজ্ঞাপনটি প্রদর্শিত হওয়ার সময় গেম লুপের মতো যেকোনো তীব্র গণনার কাজ সাময়িকভাবে বন্ধ করার কথা বিবেচনা করুন। এটি নিশ্চিত করে যে ব্যবহারকারী ধীর বা প্রতিক্রিয়াহীন গ্রাফিক্স বা তোতলানো ভিডিওর অভিজ্ঞতা না পান।
ব্যবহারকারীদের বিজ্ঞাপন দিয়ে ভরে দেবেন না।
While increasing the frequency of interstitial ads in your app might seem like a great way to increase revenue, it can also degrade the user experience and lower click-through rates. Make sure that users aren't so frequently interrupted that they're no longer able to enjoy the use of your app.

অতিরিক্ত সম্পদ

  • HelloWorld উদাহরণ : সকল বিজ্ঞাপন ফর্ম্যাটের একটি ন্যূনতম বাস্তবায়ন।
* নমুনা ব্যবহারের ক্ষেত্রে