Skip to main content
Table of contents

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.

Ad Server - Setup Line Items

Criteo App Bidding solution works best with high-density price granularity line item setup. You will need to create the first line item as a base template and duplicate the line item for all other price granularity.

For each price granularity, your line items should have matching CPM rates and keyword targeting. For example, a $1 line item would have a $1 CPM rate as well as 1.00 keyword targeting. Please note that keyword targeting is always defined in two decimal places.

Ad Server Setup - Creative

Assuming that your ad server will handle the presentation of the ad and create an appropriate webview in order to render the ad, below is an example of a creative you can set up in your ad server.

With the macro available from your ad server, retrieve crt_displayUrl as src property of a <script> tag.