Batch Serve Ad
Last updated
Last updated
The Batch Serve Ad feature is a major update in this SDK release, designed to streamline and optimize the process of serving ads in Unity projects.
Key Benefits:
Single API Call: Instead of making multiple calls for each ad surface, the Batch Serve Ad feature allows developers to serve ads for multiple surfaces in a single API call.
Efficiency: This reduces the number of network requests, leading to faster and more efficient ad serving.
Scalability: The feature supports serving multiple ads per surface, accommodating various ad campaign requirements.
How It Works:
Global Registration: Ad surfaces are registered globally, enabling the SDK to track and manage all ad surfaces across different scenes.
Batch Request: A batch request is made to the server, specifying the number of ads needed for each surface.
Ad Distribution: The server returns a list of ads, which are then distributed evenly across the registered surfaces.
Visual Indicators: Gizmo indicators appear in the editor when an ad surface is selected, providing a visual representation of the ad setup.
Implementation Details:
Ad Surface Registration: Each ad surface registers itself upon instantiation, adding itself to a global list. It happens automatically, and you should not do anything extra once you have adsurfaces created/ instantiated in your scene.
You can also check the behavior of the Batch Serve Ad through the editor via
Window -> Reneverse -> BatchServeAd
The place where to call this method is up to you:. For example, in the scene itself it can be called like so:
And this how might look like transitioning from the other scene:
In addition to serving ads, you can also disable all served ads in a batch. This is particularly useful for testing and managing ad states.
Batch Disable Ads: You can disable ads in a batch by calling the BatchDisableAds
method. This method will disable all ads that have been served through BatchServeAd
. It is also exposed in Window -> Reneverse for testing.