Skip to content

Attention measurement

The attention measurement of each placement has to be collected during the entire user’s visit.

In order to be synced with the reports provided by your ad server, we listen to the events it produces and start our measurer on the one best fit the moment an ad is rendered on the page.

Supported Ad Servers

Supported Ad Server Names Event name used to start measurer
Google Ad Manager (via Google Publisher Tag) slotRenderEnded
Smart AdServer load
Appnexus (via Xandr) adLoaded

The following information explains the generic process to interface not natively supported ad server with Adagio. You need to get in touch with your Adagio Support contact csm@adagio.io in order to validate the setup.

For ad servers who are not natively supported, it is up to the proprietary ad server owner (or the publisher) to provide the signal to start a measurer for a placement when the creative is rendered.

Adagio requires the following information:

  • a flag which determines if the ad-server response is empty (no creative to render)
  • the id attribute of the HTML element in which the creative is rendered. This should match the parameter adUnitElementId in Adagio’s bidder configuration.
  • the id of the ad server creative
  • the size of the creative served

To start a measurer, call the Prebid.js adagioBidAdapter function: window.top.ADAGIO.queue.push(queueOptions) (see definitions below).

Definition ADAGIO.queue.push

Type: (options: queueOptions) => void

queueOptions

The AdagioQueue accepts only a few whitelisted actions. The queueOptions object provides the params that are related.

queueOptions.action
Type: string
The Adagio action name to trigger. This name has to be whitelisted by Adagio.

queueOptions.dataType: object
A generic object to pass any data. Each action has a specific data object which fits the needs of the action.

queueOptions.tsType: number
The timestamp on which the push() function is called. It should always be Date.now().

Definition Custom Event detail

The custom event dispatched by the ad server owner (or publisher) must implement the following properties.

detail.isEmpty
Type: boolean
The ad server sent an empty response (no creative to render)

detail.elementId
Type: string
The id attribute of the HTML element in which the creative is rendered. This id should match the parameter adUnitElementId in Adagio’s bidder configuration.

detail.creativeId
Type: string
The id of the ad server creative

detail.creativeSize
Type: string|array
The size of the served creative. Must match the format width x height or [width, height] where both width and height are numbers.E.g. 300x250, [300,250]

Example with basic javascript CustomEvent api

First dispatch the right event in your own code source

// proprietary ad server js script
…
document.dispatchEvent(new CustomEvent('myRenderEvent', {
detail: {
isEmpty: false,
elementId: 'adunit-id-xxx',
creativeId: 'crea-1111',
creativeSize: [300,250]
}
}));
…

Then register a listener to this event and call the window.top.ADAGIO.queue.push() function to pass data to Adagio

(function() {
try {
// Actually Adagio must have access to top level window.
if (window.top.location.href) {
window.top.ADAGIO = window.top.ADAGIO || {};
window.top.ADAGIO.queue = window.top.ADAGIO.queue || [];
window.document.addEventListener('myRenderEvent', function(evt) {
window.top.ADAGIO.queue.push({
action: 'adagio-my-adserver-events', // Adagio whitelisted action
data: {
eventName: 'renderEvent',
args: evt.detail
},
ts: Date.now()
});
});
}
} catch (error) {
return false;
}
})();