Thumbnail
This article will guide you through all the steps necessary to display an Thumbnail ad in your application.
Last updated
This article will guide you through all the steps necessary to display an Thumbnail ad in your application.
Last updated
Thumbnail ads are small rectangle ads that are displayed as overlays to your application content. They are closable and draggable by the user, and can be used to (i) monetize your application through new incremental inventories and (ii) push cross-promotion campaigns.
Ensure you have registered your application on the Ogury Dashboard. If not, please refer to the Getting Started page before proceeding.
on your asset page in the Ogury Dashboard.
, as you will need it for integration. It is in the form of a UUID, which consists of a 36-character string formatted as follows: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
, where each x
represents a hexadecimal digit.
In the following code samples, this ad unit ID will be represented as xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
.
To load a Thumbnail ad, instantiate an OguryThumbnailAd
object and call its load()
method.
By default, the ad loads with a maximum size of 180x180 points. If needed, you can customize the maximum size by following the guidelines provided in Customizing Thumbnail ad size section.
OguryThumbnailAd
takes the following parameter:
an adUnitID
: the Ad unit id of the Thumbnail Ad. If you do not have one yet, you can refer to the first step to create it.
If you are developing a mediation adapter, you must pass an additional parameter, OguryMediation
which should be instantiated with:
name
: the name of the mediation.
version
: the version of the mediation SDK.
You can monitor the lifecycle of your Thumbnail ad by implementing the OguryThumbnailAdDelegate
protocol. This delegate provides real-time updates on key events, such as successful ad loading, display or errors.
To use it, set your class as the delegate of OguryThumbnailAd
and implement the necessary methods. This ensures timely notifications, allowing you to manage the ad experience effectively.
If the thumbnailAd:didFailWithError
callback is triggered, refer to the Error handling section below for detailed information on troubleshooting.
To display an loaded Thumbnail ad, invoke the show()
method on the instantiated OguryThumbnailAd
object.
By default, Thumbnail ad is aligned to the bottom-right corner, maintaining a margin of 20 points from the right edge and 150 points from the bottom.
Additionally, a Thumbnail ad is shown in a ViewController only if its bundle identifier matches the main bundle of the application. For details on how to customize these default settings using whitelists and blacklists, please see the Customizing Thumbnail ad display section
The show()
method requires the following parameter:
A reference to the ViewController
where the Thumbnail ad will be presented.
Always verify that the ad is loaded before invoking the show()
method, particularly if you are not calling it from the thumbnailAdDidLoad
callback.
After registering your app, it may take up to 15 minutes before ads are available.
Ogury exclusively serves ads to users who have provided their consent. Before conducting any tests, it is essential to ensure that your implementation complies with applicable privacy regulations. For more information on the regulations supported by Ogury, please visit the Privacy compliance page.
Since our algorithm uses personalized targeting, you may not receive ads during testing. To obtain test ads, you can append _test
to your Thumbnail ad unit ID in the code, for example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx_test
.
For further details on test mode and enabling debug logs, please refer to the Test your implementation page.
To adjust the size of a Thumbnail ad, use the load()
method with maxWidth
and maxHeight
parameters:
The maxWidth
and maxHeight
parameters specify the maximum dimensions, in points, that the Thumbnail ad will occupy on the screen.
For optimal readability and ad display quality, we recommend setting maxWidth = 180
and maxHeight = 180
. For instance, if you set these values and the Ogury SDK decides to show a 16:9 video ad, the Thumbnail ad will resize to 180x101 points to maintain the 16:9 ratio.
Constraints:
maxWidth
and maxHeight
cannot exceed the device’s screen size.
Both maxWidth
and maxHeight
must be at least 101 points.
The longest side, either maxWidth
or maxHeight
, must be at least 180 points.
Thumbnail ads remain visible while users navigate between ViewControllers in your application.
By default, a Thumbnail ad is shown in a ViewController only if its bundle identifier matches the main bundle of the application. However, you can customize these default settings using whitelists and blacklists.
You can expand the list of whitelisted bundles where Thumbnail ads can be displayed and remain on-screen. This is particularly useful if your app includes ViewControllers provided by a library, such as a game engine. In this case, you will need to whitelist the associated bundle.
To whitelist bundles, call the setWhitelistBundleIdentifiers
method:
To prevent Thumbnail ads from being displayed in specific ViewControllers, use the setBlacklistViewControllers
method:
When a user navigates to a ViewController that is neither in the whitelisted bundles nor explicitly blacklisted, the Thumbnail ad will be hidden and paused. It will reappear when the user returns to a permitted ViewController.
If you are unable to load or display any Thumbnail ads, we recommend logging callbacks from the OgurythumbnailAdDelegate
to monitor the ad's lifecycle, especially the thumbnailAd:didFailWithError
callback. This method provides an an OguryAdError
instance containing important error details:
type
: indicates the error type through the OguryAdErrorType
enum, which distinguishes between loading errors (OguryAdErrorTypeLoad
) and showing errors (OguryAdErrorTypeShow
).
code
: An integer that identifies the specific error. The enums OguryLoadErrorCode
and OguryShowErrorCode
define potential error codes that may occur during loading or showing ads. Further details on these enums are provided in the tables below.
localizedDescription
: A descriptive message that provides additional context about the error.
You can utilize these details to diagnose the issue and take appropriate action to resolve it.
Enum value | Description |
---|---|
Enum value | Description |
---|---|
SDKNotStarted
The load could not proceed because the SDK appears to have not been started.
SDKNotProperlyInitialized
The load could not proceed because the SDK is not properly initialized.
NoActiveInternetConnection
The load could not proceed because there is no active Internet connection.
InvalidConfiguration
The load could not proceed due to an invalid SDK configuration.
AdDisabledCountryNotOpened
The load could not proceed because ads are disabled; the user’s country is not yet available for advertising.
AdDisabledConsentDenied
The load could not proceed because ads are disabled; the user has denied consent for advertising.
AdDisabledConsentMissing
The load could not proceed because ads are disabled; the user consent is missing or has not been provided.
AdDisabledUnspecifiedReason
The load could not proceed because ads are disabled for an unspecified reason.
AdRequestFailed
The load failed because the ad request encountered an error, and the server returned an unexpected response.
NoFill
No ad is currently available for this placement (no fill).
AdParsingFailed
The ad could not be loaded due to a failure in parsing.
AdPrecachingFailed
The ad could not be loaded due to a failure in ad precaching.
AdPrecachingTimeout
The ad could not be loaded as precaching exceeded the time limit and timed out.
SDKNeverStarted
The ad could not be displayed because the SDK appears to have not been started, as no asset key was found.
SDKNotProperlyInitialized
The ad could not be displayed because the SDK is not properly initialized.
NoActiveInternetConnection
The ad could not be displayed because there is no active Internet connection.
InvalidConfiguration
The ad could not be displayed due to an invalid SDK configuration.
AdDisabledCountryNotOpened
The ad could not be displayed because ads are disabled; the user’s country is not yet available for advertising.
AdDisabledConsentDenied
The ad could not be displayed because ads are disabled; the user has denied consent for advertising.
AdDisabledConsentMissing
The ad could not be displayed because ads are disabled; the user consent is missing or has not been provided.
AdDisabledUnspecifiedReason
The ad could not be displayed because ads are disabled for an unspecified reason.
AdExpired
The ad could not be displayed because the retention time of the loaded ad has expired.
NoAdLoaded
No ad has been loaded.
ViewInBackground
The ad could not be displayed because the application was running in the background.
AnotherAdAlreadyDisplayed
The ad could not be displayed because another ad is currently being displayed.
WebviewTerminatedBySystem
The ad could not be displayed because the WebView was terminated by the system, resulting in the ad being unloaded due to high resource consumption by the application.
ViewControllerPreventsAdFromBeingDisplayed
The ad could not be displayed because a ViewController is currently being presented, preventing the ad from displaying.