App Bidding - In-House bidding - SDK Initialization
Criteo SDK is designed to be used as a singleton. We have provided access to the singleton instance via the sharedCriteo property of the Criteo class.
Initialize Criteo SDK, ideally in your AppDelegate, with registerCriteoPublisherId:withAdUnits:. This needs to be done only once.
Parameter | Type | Description |
|---|---|---|
criteoPublisherId | | Your Criteo Publisher ID. |
adUnits | | List of AdUnits you'd like Criteo to monetize |
storeId | | Your app’s unique identifier that is used in the Apple App Store. |
App Bidding - In-House bidding - Banner - Load Criteo Bids
Load Criteo bids using loadBidForAdUnit:responseHandler: method that takes 2 parameters:
Parameter | Type | Description |
|---|---|---|
adUnit | | CRBannerAdUnit object for this request |
responseHandler | | A handler that will be executed when a response is received, or timed out. The handler passes a |
On the response handler, non-null Bid object indicates bid availability from Criteo. Retrieve Criteo's CPM bid price with price property.
App Bidding - In-House bidding - Banner - Displaying Banner
When Criteo wins your auction, create a CRBannerView object and call loadAdWithBid: method by passing the previously obtained CRBid object to display Criteo banner.
Finally, add the CRBannerView object to a view with the correct frame.
App Bidding - In-House bidding - Banner - Banner Delegate Methods
You can optionally add delegate methods to your ViewController in order to get notified when the banner view has loaded, failed to load, or there's a click resulting in the user leaving the application, by implementing CRBannerViewDelegate protocol on your ViewController.
Assign your CRBannerView object's delegate to self, and you can implement bannerDidReceiveAd:, banner:didFailToReceiveAdWithError: and bannerWillLeaveApplication: methods.
App Bidding - In-House bidding - Interstitial - Load Criteo Bids
Load Criteo bids using loadBidForAdUnit:responseHandler: method that takes 2 parameters:
Parameter | Type | Description |
|---|---|---|
adUnit | | CRInterstitialAdUnit object for this request |
responseHandler | | A handler that will be executed when a response is received, or timed out. The handler passes a |
On the response handler, non-null Bid object indicates bid availability from Criteo. Retrieve Criteo's CPM bid price with price property.
App Bidding - In-House bidding - Interstitial - Loading Interstitial Ads
When Criteo wins your auction, create a CRInterstitial object and call loadAdWithBid: method by passing the previously obtained CRBid object to prefetch Interstitial ad that you can display later in your app.
App Bidding - In-House bidding - Interstitial - Displaying Interstitial Ads
Display previously-loaded Interstitial ad by presenting the view from RootViewController with calling presentFromRootViewController: method. Make sure to always check whether the Interstitial ad has been loaded using isAdLoaded before presenting Criteo Interstitial ad to the user. You can alternatively listen to interstitialDidReceiveAd: delegate method to make sure that the Interstitial ad is ready to be displayed.
App Bidding - In-House bidding - Interstitial - Interstitial Delegate Methods
You can optionally add delegate methods to your ViewController in order to get notified before/after the Interstitial ad has loaded, failed to load, appear, disappear, or there's a click resulting in the user leaving the application, by implementing CRInterstitialDelegate protocol on your ViewController.
Assign your CRInterstitial object's delegate to self, and you can implement Interstitial delegate methods like the code example.
App Bidding - In-House bidding - Advanced Native
Advanced Native enables you to render your native ads using UI components that are native to the platform.
Prerequisites
This guide assumes that you have initialized Criteo SDK according to the In-House Bidding integration guide.
App Bidding - In-House bidding - Advanced Native with a Simple Layout - Load Criteo Bids
Load Criteo bids using loadBidForAdUnit:responseHandler: method that takes 2 parameters:
Parameter | Type | Description |
|---|---|---|
adUnit | | CRNativeAdUnit object for this request |
responseHandler | | A handler that will be executed when a response is received, or timed out. The handler passes a |
On the response handler, non-null Bid object indicates bid availability from Criteo. Retrieve Criteo's CPM bid price with price property.
App Bidding - In-House bidding - Advanced Native with a Simple Layout - Native Loader
When Criteo wins your auction, create a CRNativeLoader object that will be an entry point and responsible for loading Criteo Native ads. Then set the native loader's delegate to your ViewController that conforms to CRNativeLoaderDelegate protocol.
Finally, invoke loadAdWithBid: on your native loader object with the previously obtained CRBid object to load your native ad.
App Bidding - In-House bidding - Advanced Native with a Simple Layout - Native Ad View
Create a custom class for your Native Ad View. In this guide, we'll create CriteoNativeAdView class that extends CRNativeAdView.
Then, create an .xib file with the same name as your custom class name. You can define your native views in this interface builder file. Set the view's custom class name.
Criteo uses CRMediaView in order to display images. Please use CRMediaView custom view instead of UIImageView in your .xib file.
Make sure to create an outlet for every views in your custom class.
You will find attached the code showing how CriteoNativeAdView class might look like.
Finally, on your Storyboard, define a View as a placeholder for your native ad view, and create an outlet on the ViewController.
App Bidding - In-House bidding - Advanced Native with a Simple Layout - Native Loader Delegate
Implement CRNativeLoaderDelegate methods in your ViewController. At a minimum, you will need to implement nativeLoader:didReceiveAd: method in order to initialize and fill your native view.
In the sample code below, we are loading the .xib file called CriteoNativeAdView created on the previous step, set the nativeAd property, fill every elements with native assets, and finally add the native ad view into the placeholder.
The following native assets are available on CRNativeAd object:
Native Asset | Property | Type | Recommended View |
|---|---|---|---|
Ad Title | | | |
Ad Description | | | |
Ad Price | | | |
Ad Image | | | |
Call To Action | | | |
Advertiser Domain | | | |
Advertiser Name | | | |
Advertiser Logo | | | |
Legal Text | | | |
App Bidding - In-House bidding - Advanced Native with a Simple Layout - AdChoices Logo
An AdChoices logo will be automatically added to the ad view by Criteo SDK. Please leave a space in the top-right corner of your native ad view for the automatically inserted AdChoices logo. The rendered AdChoices logo will take up 19x15 points on the screen.
App Bidding - Standalone SDK
This guide explains how to integrate Criteo Direct Bidding for App solution to your iOS app as a Standalone Ads SDK.
Prerequisites
App Bidding - Standalone SDK - SDK Initialization
Criteo SDK is designed to be used as a singleton. We have provided access to the singleton instance via the sharedCriteo property of the Criteo class.
Initialize Criteo SDK, ideally in your AppDelegate, with registerCriteoPublisherId:withAdUnits:. This needs to be done only once.
Parameter | Type | Description |
|---|---|---|
criteoPublisherId | | Your Criteo Publisher ID. |
adUnits | | List of AdUnits you'd like Criteo to monetize. |
