Skip to main content
Table of contents

Introduction

Welcome! This document will explain integrating with Commerce Grid's Standalone / Publisher Tag solution.

Criteo provides a piece of code to be added in the header of the pages before the ad server callout. This generates an asynchronous call so Criteo can identify the user and return a bid. This information, including the bid price, is then sent to the adserver.

Criteo campaigns are targeted in the adserver based on Custom keyword criteria.

Requirements

You will receive from Criteo:

  • A script is to be placed on the header of your pages. Don't use the examples from this guide

  • Creative codes to be used in the adserver

We will need you to:

  • Implement the scripts on the page header

  • Update your adserver setup. Alternatively, your Criteo contact can provide an automated solution.

    • Create the line items for the different bid prices in your adserver

    • Implement the targeting rules and the creative code

  • Criteo complies with the IAB Consent Framework. Please refer to their documentation for more information and examples of certified CMPs.

Standalone Script - Loader

This code initializes the Criteo tags. The code will load the publishertag.js library and will also build the events queue that will be used later. The loader request is asynchronous and is cached on the user's browser. Please place this code before the DFP tags detailed below.

Standalone Script - Placement mapping info

Standalone Scripts - DFP tags

All you need to do now is to identify your existing DFP tags (see sample on the right) .

You can also find a working example on this page.

Standalone Scripts - Lazy load

For units that are loaded after the initial page load (i.e. lazy load, infinite scroll, single-page application rendering), pass the DFP slot(s) as an array through the placements field in the object that is passed in the RequestBidsOnGoogleTagSlots function.
This will cause requests to be sent only for specific placements instead of all placements on the page.

Field

Type

Description

placements

Array

List of GPT slot objects


Bid Request - Passing bid price floors

You can set bid price floors in the ad unit declaration by adding an extension object to the placements declared, as placements[].ext.floors. You can set floors per media type and per size as in the example on the left. You can use the wildcard character (“*”) to define a default floor for all sizes. Make sure to specify the currency in which the floor is expressed via the “currency” field, please note it is required and not specifying it will result in the floor being discarded and thus ignored.

User ID Collection

To enrich the bid request data with user IDs (1st party user IDs, 3rd party IDs, or hashed emails), please use the function Criteo.SetIdentities as described in the sections below.

This function accepts an array of OpenRTB EIDS objects as input:

Field

Type

Description

source

String

Identifier source URL (publisher URL or vendor URL).

uids[].id

String

User identifier

uids[].atype

Integer

Identifier type. 1: an ID which is tied to a specific web browser or device (cookie-based, probabilistic, or other). 2: in-app impressions, which will typically contain a type of device ID (or rather, the privacy-compliant versions of device IDs). 3: a person-based ID, i.e., that is the same across devices.

uids[].ext.stype

String

ID Source type. "dmp" if comes from the in-page DMP named in eids.source. "ppuid" if comes from the publisher named in eids.source

uids[].ext.persistence

String

(Optional, Criteo-specific) "http" if the 1PC was set through an HTTP Set-Cookie directive or "js" if the 1PC was set through JavaScript (either in a cookie or in the local storage).

User ID Collection - First Party IDs

Use the function Criteo.SetIdentities providing the data below (examples on the right):

  • source: your domain

  • id: the user identifier

  • atype: Must be 1 for cookie/device-based ID, must be 3 for person-based ID (e.g.: authenticated user ID, login ID, CRM/customer ID)

  • ext.stype: ppuid

  • ext.persistence: js or http

User ID Collection - Third Party IDs

Use the function Criteo.SetIdentities providing the data below (examples on the right):

  • source: the third-party solution domain

  • id: the user identifier

  • (recommended) atype: 1 for cookie/device based ID, 3 for person-based ID (eg: authenticated user ID, login ID, CRM/customer ID)

  • (optional) ext.persistence: js or http

User ID Collection - Hashed Emails

Use the function Criteo.SetIdentities providing the data below (examples on the right):

  • (optional) source: your domain or the domain of the solution operating on your behalf

  • id: the user data

  • atype: 3

  • ext.stype: hashing algorithm used: cleartextemail, hemsha256, hemmd5, hemsha256md5. Please refer to the next section for details on hashing formats.

Hashing Formats

The hashing should be the users’ email address:

  • Encoded in UTF-8

  • Trimmed of any white space (eg: “test@criteo.com “ should become “test@criteo.com”)

  • Converted to lowercase

  • Hashed with MD5/SHA256/SHA256(MD5) & output as ASCII text

Example:

  • Type: String

  • Original Email: john.doe@gmail.com

  • SHA256: 375320dd9ae7ed408002f3768e16cb5f28c861062fd50dff9a3bff62e9dce4ef

  • MD5: e13743a7f1db7f4246badd6fd6ff54ff

  • SHA256 of MD5: 000e3171a5110c35c69d060112bd0ba55d9631c7c2ec93f1840e4570095b263a

Helpful links: https://www.miraclesalad.com/webtools/md5.php and https://www.miraclesalad.com/webtools/sha256.php

User ID Collection - Phone Numbers

Use the function Criteo.SetIdentities providing the data below (example on the right):

  • (optional) source: your domain or the domain of the solution operating on your behalf.

  • id: the user data

  • atype: 3

  • ext.stype: hashing algorithm used. It can be either pnclear if the phone number is hashed, or pnsha256 if the phone number is in clear. Please refer to next section for details on hashing formats.

HASHED PHONE NUMBERS

Criteo uses SHA256 as a hashing method. The expected underlying phone numbers format is trimmed E.164 format, including the country code, without the leading "+" sign (so only 15 digits, at most): sha256(internationalPhoneNumber.replaceAll(/[^0-9]/g, "")).

Example:

  • 1 (234) 567-8910 → sha256(12345678910) → 63640264849a87c90356129d99ea165e37aa5fabc1fea46906df1a7ca50db492

  • 81-12-3456-7891 → sha256(811234567891) → d9825fb05347d3c910fc5202c0c20d07a87b791cc643c6f2d70402394a849540

  • 02 1234 5678 → sha256(0212345678) → 826f54894e28f3f1795f3c5e3335cf98709c5d5b38b3f9c6d72467d491f032df

  • +33 1 40 40 22 90 → sha256(33140402290) → fda66831d0cb0eb4bffb21bc795308d69921c211c57be0ae15702071e3b9e988

CLEAR PHONE NUMBERS

Clear phone numbers are accepted to ease the integration.

Any international formats are accepted (including the leading "+" sign). Normalization remove all non numeric characters

Validation checks:

Number starts with a + sign length is at most 15 digits there is no leading 0: many countries use 0 as national dial number Then backend map the clear phone numbers to SHA256 HPN so the two accepted formats are uniform.

Examples:

  • +1 (234) 567-8910

  • +81-12-3456-7891

  • +33 1 40 40 22 90

  • 02 1234 5678 is rejected because of a leading 0 indicating that it is a national phone number

Adserver setup - Keywords

Go to Inventory > Key-values and click on New Key and create the key-value

  • Key name: crt_pb

  • Value type: Users will enter targeting values when creating line items or checking inventory. (Free-form)

Adserver setup - Order

Go to Delivery > All orders and click on New Order and create one new Order for the Commerce Grid campaign.

Adserver setup - First Line Item

You can create the first line on the same page. The goal is to create one dedicated line item per different CPM price bands.

We will create the unitary CPM for this first line item:

  • Name: Please use a self-explanatory name like chb_1.00

  • Inventory sizes: Please include all formats available on your page. Eg: 728x90, 300x250

  • Labels section: Please check Allow same advertiser exception

  • Type: Please select the priority as agreed with your Criteo representative.

  • Start time: Immediately

  • End time: Unlimited

  • Limit: None

  • Rate: Please include here the CPM. In this first example, we will use $1.00

  • Display Creatives: One or More.

  • Rotate Creatives: Evenly

Finally, please select the inventory for the campaign and add the following targeting:

  • Type: Choose Key-values

  • Select a key: Choose crt_pb

  • Value: Choose is and input 1.00

Finally, hit save and follow with the creative steps below.

Adserver setup - Creatives

Go to Delivery > Creatives > All creatives and click on Add creative and type the same advertiser name.

  • Type: Third-party

  • Name: CDB_OnPage_Creative1

  • Code snippet: paste the code located on the right

  • Size: 1x1

  • Please un-tick the SafeFrame mode

Hit Save.

Go back to the first line item created, click on the Creatives tab and on use existing creatives.

Click on Show all and you will be able to list and include the recently created one.

Go back to this creative settings (Creatives tab > Click on the creative > Settings) and update the Size overrides with all the formats available on your page.

The last step is to duplicate this creative with as many unique ad units as you have on the same page. I.e.: Should you have up to 5 different ad units on your homepage, this means you will need to set up at least 5 creatives for this line item.

The easiest way to achieve this is by selecting one (or multiple) creatives and click on. More actions > Copy creative until you have the minimum amounts required.

5_DFP_creative_1 (1).png
5.3 KB
5_DFP_creative_2 (1).png
60.4 KB
5_DFP_creative_3 (1).png
16.5 KB
5_DFP_creative_4 (1).png
15.1 KB
5_DFP_creative_5 (1).png
22.8 KB
5_DFP_creative_6 (1).png
11.8 KB

Adserver setup - Remaining line items

Now that you have the first line item fully configured, you can simply duplicate it and reuse the existing creatives. Please contact your Criteo representative for an alternative automated solution. To proceed otherwise, go to the line item pages, select its respective checkbox, and click on More actions > Copy and share creatives. Repeat this action for all the different price bands you have.

Please don't forget to update:

  • The line item name

  • The CPM

  • The keyword targeting the respective price band

You can edit those values directly from the list page by clicking on the icon on the corner of each field:

  • Line item name

  • CPM

  • Inventory and keyword targeting

  • Start date. Please double-check this value, as the default one is the next day!

Once you are set, select all the new line items and click on the Resume button.

6_DFP_lineitem_1 (1).png
21.7 KB
6_DFP_lineitem_2 (1).png
8.4 KB
6_DFP_lineitem_3 (1).png
1.4 KB
6_DFP_lineitem_4 (1).png
9.9 KB
6_DFP_lineitem_5 (1).png
6.3 KB

AMP

Criteo's solution is compatible with AMP RTC. Please refer to this dedicated AMP guide for more details.

Native Ads - Native Placement

In order to activate Native demand, first you need to implement a Javascript callback function that provides instructions on how the Native ad should be rendered. Please let your Criteo representative be aware of the function name, or simply name it nativeCallback as on the example aside.

Native Ads - Native Object

When native demand is available, Criteo will run the nativeCallback using the following Native object as argument:

NATIVE OBJECT

Field

Type

Description

product

Product object Array

List of product assets.

advertiser

Advertiser object

Includes the adv name and logo

privacy

Privacy object

Includes adchoices and opt-out url

impression_pixels

Impression pixels object Array

List of impression pixels

PRODUCT OBJECT

Field

Type

Description

title

String

Product title.

description

String

Product description.

price

String

Product formatted price. It comes formatted by default with the currency symbol.

click_url

String

Product landing page

call_to_action

String

Product CTA

image

Image object

Product image (400x400 px)

IMAGE OBJECT

Field

Type

Description

url

String

Image URL.

height

Integer

Image height

width

Integer

Image width

ADVERTISER OBJECT

Field

Type

Description

description

String

Advertiser name

domain

String

Advertiser domain

logo

Image object

Advertiser logo (200x200 px)

PRIVACY OBJECT

Field

Type

Description

optout_click_url

String

Opt-out landing page URL

optout_image_url

String

Adchoices icon URL

IMPRESSION PIXEL OBJECT

Field

Type

Description

url

String

Impression pixel beacon

Native Ads - Adserver integration

The campaigns are configured as the normal campaign and you can reuse the same Creative codes for the standard ads. The Criteo.RenderAd() function will automatically identify the native ad context and run the callback function that you have previously declared (nativeCallback on this example).

Native Ads - Ad requirements

Criteo Native guidelines:

  • Display the adchoices icon and implement the link to the opt-out page

  • Display at least one advertiser information (domain, name)

  • Display at least one product recommendation

  • Use Criteo click URLs

  • Every impression pixel must be called once the ad is delivered

Native Ads - Product Images


Criteo images for native inventory will be sized to fit within a 400x400 html element. They will not be padded to fit the dimensions or ratio, they should therefore be centered in the layout by the partner.

Native Ads - Complete example

You will find a full example on this page. Please check the source-code around the <h1>Native 1</h1> area

Video - Video Placement

Ad unit mapping is required for video. Make sure to properly set up the mediaTypes.video object as shown in the example. Refer to the Video Object for a full list of parameters.

Video - Video Object

Name

Scope

Description

Example

Type

context

required

outstream, instream or long-form

instream

string

placement

required

Video placement type. In-Stream: 1; In-Banner: 2; In-Article: 3: In-Feed: 4; Interstitial: 5;

1

integer

playerSize

required

Width and height of the player

[640, 480]

Array

mimes

required

List of the content MIME types supported by the player

["video/mp4"]

Array

protocols

required

Supported video bid response protocols. VAST 1.0: 1; VAST 2.0: 2; VAST 3.0: 3; VAST 1.0 Wrapper: 4; VAST 2.0 Wrapper: 5; VAST 3.0 Wrapper: 6;

[5, 6]

Array

playbackmethod

required

Defines how the video inventory is initiated. Page Load with Sound On: 1; Page Load with Sound Off: 2; Click with Sound On: 3; Mouse-Over with Sound On: 4; Entering Viewport with Sound On: 5; Entering Viewport with Sound Off by Default: 6;

[4, 5]

Array

skip

required

Ability from the video player for the user to skip the video. Not skippable: 0; Skippable: 1;

1

integer

api

required

API frameworks supported. VPAID 1.0: 1; VPAID 2.0: 2; MRAID-1: 3; ORMMA: 4; MRAID-2: 5;

[1, 2]

Array

maxduration

required

Maximum ad duration in seconds

20

integer

minduration

optional

Minimum ad duration in seconds

5

integer

startdelay

optional

Duration offset (in second) from the start of the content for showing the video ad before the start of the Video. Pre-roll: 0 (default); Mid-roll: >0; Default mid-roll: -1; Post-roll: -2;

5

integer

videoCallback

optional

Callback renderer used to render Outstream unit with publisher renderer (currently required for outstream!)

function(bid) {//Code to render outstream unit}

function

Video - Video Instream

GOOGLE AD MANAGER INTEGRATION

The Criteo.SetDFPVideoKeyValueTargeting function is a helper method which will append Criteo key-values to your existing GAM Vast url. Once the url is enriched, it is ready to be passed to your instream player for rendering.

Note: The gamUrl in the example is a sample GAM Vast tag. Replace with your own Vast tag!

OTHER AD SERVERS INTEGRATION

The RequestBids callback will contain the returned bids where you will have access to the full bid object (i.e cpm, vastUrl) to handle as needed. Refer to Video Bid Object to see the list of parameters available.

Video - Video Outstream

For outstream rendering with your own renderer, make sure you've set up the videoCallback function in your Video Placement mapping.

Outstream integration is set up similarly to a standard banner integration. Bids are requested, and upon returned Criteo key-values are appended to the ad call.

Video - Video Bid Object

Name

Description

Example

vastUrl

Criteo vast url

https://ads.us.criteo.com/vast...

vastXml

Criteo vast Xml Creative

< Vast>...</ Vast>

cpm

Bid price

5.00

slotid

Id of the slot of the selected bid

video1

Video - Ad Server Setup

Outstream campaigns are configured exactly the same as the standard campaigns, using the same creative code. The Criteo.RenderAd() function will automatically identify the video ad context and run the video callback function that you have previously declared. If you already have banner integrated, the same line items can be reused. Refer to Adserver Setup for setup details.

Instream requires its own Video VAST line items. Please see below for setup details:

KEYWORDS

Go to Inventory > Key-values and click on New Key to create new key-values:

  • Name: crt_pb (if not already created) and crt_format

  • Value type: Dynamic

ORDER

Go to Delivery > All orders and click on New Order to create a new Order for Criteo Video campaign.

Create a new Criteo Video Order.

LINE ITEM

Next create the first line item:

Choose Video as Ad Type.

  • Name: Use a self-explanatory name like Criteo Video Instream

  • Line Item Type: Select the priority type as agreed with your Criteo representative.

  • Expected creatives: Include all Video formats available. Eg: 640x480v, 300x400v

  • Delivery settings:

    • Rate: For our line item template, we'll use 0.01.

    • Type: CPM

Select the inventory for the campaign and add a Custom targeting crt_pb with the same value that we put in the Rate field, i.e. 0.01. Please always use two decimals within the custom targeting as Google Ad Manager handles them as Strings and not real numbers. Add additional targeting to crt_format is any of video. Make sure to use the AND relation, not OR.

CREATIVES

Go to Delivery > Creatives, click on New creative and type the same advertiser name that you used to create Order, then choose Redirect as creative type.

On the next page, enter:

  • Name: Criteo Video Creative

  • Target ad unit size: Enter one of the inventory sizes, e.g. 640x480v

  • VAST tag URL: https://ssp-ads.criteo.com/redirect?url=%%PATTERN:crt_displayUrl%%

  • Duration: 0

  • Skippable: Disabled

Hit Save.

Repeat this action for every inventory size you have on your site.

ADD CREATIVES TO LINE ITEM

Go back to the first line item created, click on the Creatives tab and on Existing creative, and you will be able to list and include the recently created ones.

Please repeat this action for every format you have configured.