Skip to main content

Introduction

This guide explains how to integrate Criteo Direct Bidding for App solution to your Android app for all other supported ad servers.

Prerequisites

SDK Initialization

Initialize Criteo SDK in your Application class by using Criteo.Builder() method. This needs to be done only once. Criteo.Builder() method takes 2 parameters:

Parameter

Type

Description

application

Application

Application Object

criteoPublisherId

String

Your Criteo Publisher ID.
Contact your Criteo representative to get your Criteo Publisher ID.

Use adUnits() method on the builder and pass List<AdUnit> object to initialize all ad units that Criteo will monetize.

Banner - Load Criteo Bids

Load Criteo bids using loadBid() method that takes 2 parameters:

Parameter

Type

Description

adUnit

BannerAdUnit

BannerAdUnit object for this request

bidResponseListener

BidResponseListener

A listener object that will be executed when a response is received, or timed out.

Banner - Set Criteo bids on Ad Server object

On the BidResponseListener#onResponse() callback, check if the Bid object is not null, then call enrichAdObjectWithBid() to set the bid on a Map object.

Parameter

Type

Description

map

Map

A Hash map where bid information will be set

bid

Bid

Bid object returned by the onResponse callback

Then, you can set the bid into your Ad Server object, and load the Banner ad.

If Criteo has bids for the current impression, Criteo SDK will update the dictionary and it will contain the following keys:

Key

Value Type

Description

crt_cpm

String

CPM bid in numerical string format

crt_displayUrl

String

Display URL to be added into a <script> tag

crt_size

String

Size of banner in [width]x[height], e.g. 320x50

You will then be able to use crt_cpm to let Criteo participates in your bidding ad server, crt_displayUrl and crt_size to render the banner when Criteo wins the auction. In a standard ad server setup, these 3 values are set as keyvalue targeting.

Interstitial - Load Criteo Bids

Load Criteo bids using loadBid() method that takes 2 parameters:

Parameter

Type

Description

adUnit

InterstitialAdUnit

InterstitialAdUnit object for this request

bidResponseListener

BidResponseListener

A listener object that will be executed when a response is received, or timed out.

Interstitial - Set Criteo bids on Ad Server object

On the BidResponseListener#onResponse() callback, check if the Bid object is not null, then call enrichAdObjectWithBid() to set the bid on a Map object.

Parameter

Type

Description

map

Map

A Hash map where bid information will be set

bid

Bid

Bid object returned by the onResponse callback

Then, you can set the bid into your Ad Server object, and load the Interstitial ad.

If Criteo has bids for the current impression, Criteo SDK will update the dictionary and it will contain the following keys:

Key

Value Type

Description

crt_cpm

String

CPM bid in numerical string format

crt_displayUrl

String

Display URL to be added into a <script> tag

You will then be able to use crt_cpm to let Criteo participates in your bidding ad server, and crt_displayUrl to render the Interstitial ad when Criteo wins the auction. In a standard ad server setup, these 2 values are set as keyvalue/keyword targeting.