Shared Configurations
This page gives you an overview of configurations that you can apply to all ad formats
Parameter Configuration Details
Below you'll find a list of parameters that can be used for all Ogury Ad formats. There might be differences depending on the used integration type. Note that prebid integration will require camel case notation whereas all other integration types will use snake case notations. All parameters are case sensitive.
ad_unit_id
Description
The ID of your ad unit - defines ad format and integration type
Prebid.js Notation
adUnitId
Required
yes
Type
String
Example Value
'97e72f94-91c2-4f16-acca-1b769146de3b'
asset_key
Description
The asset key for your publisher account - directly linked to your domain
Prebid.js Notation
assetKey
Required
yes
Type
String
Example Value
'OGY-3FF6A2B9350D'
passback
Description
Object that defines a second ad unit configuration that will be requested if on_no_ad or on_error have been triggered
Prebid.js Notation
n/a
Required
yes
Type
Object
Example Object
passback: { ad_unit_id: '97e72f94-91c2-4f16-acca-1b769146de3b'}
abort_tag_execution
Description
Will stop the tag and therewith the ad request execution
Prebid.js Notation
n/a
Required
no
Type
Boolean
Values
true|false
Default Value
false
on_ad_show
Description
Callback function that will be executed when the ad is displayed
Prebid.js Notation
onAdShow
Required
no
Type
function
Parameters
adUnit: Object
positionState: String
adResponseContext: Object
Example function
function onAdShowCallback(adUnitObject, positionState, adResponseContext){ // your code }
on_ad_complete
Description
Callback function that will be executed when the ad has been clicked, closed or finished
Prebid.js Notation
onAdComplete
Required
no
Type
function
Parameters
adUnit: Object
adResponseContext: Object
Example function
function onAdCompleteCallback(adUnitObject, adResponseContext){ /** your code */ }
on_position_change
Description
Callback function that will be executed when the state of the ad changes
Prebid.js Notation
onPositionChange
Required
no
Type
function
Parameters
positionState: String : 'EXPANDED', 'STUCK_MINIMIZED', 'MINIMIZED, 'DEFAULT'
Example function
function onPositionChangeCallback(adUnitObject, adResponseContext){ /** your code */ }
on_no_ad
Description
Callback function that will be executed when the ad response is empty
Prebid.js Notation
n/a
Required
no
Type
function
Example function
function onNoAdCallback(){ /** your code */ }
on_error
Description
Callback function that will be executed when an error occurs. This can happen before, during and after the ad delivery.
Prebid.js Notation
onError
Required
no
Type
function
Example function
function onErrorCallback(){ /** your code */ }
Supported Custom Events
ogy_hide
background
pause
hide
ogy_show
foreground
play
show
ogy_pause
background
pause
do nothing
ogy_play
foreground
play
do nothing
Example Configurations
To help you understand and using certain configurations you'll find several examples in the following paragraphs. The examples will use tag based connotation.
How to use Callbacks
Callbacks provide a way to handle different Ad Response situations such as no ad available.
To use the callbacks, you'll need to create the JavaScript Functions that are supposed to be called for the different statuses first. Afterwards you can pass them as values for on_ad_show
, on_no_ad
, on_ad_complete
, on_error
or all together, and they'll be executed for the particular event:
on_ad_show
: the function that is set for this parameter will be triggered when an ad has started to be shown by the Ogury Tag.on_position_change: the function that is set for this parameter will be triggered when an ad has switched from a positionState to another. The positionState value is sent back in the callback.
Possible values for positionState: 'EXPANDED', 'STUCK_MINIMIZED', 'MINIMIZED', 'DEFAULT'.
on_no_ad
: the function that is set for this parameter will be triggered when the Ogury Tag has no ads to serve.on_ad_complete
: the function that is set for this parameter will be triggered when the ad is closed. This happens:if the user clicks on the ad
if the user clicks on the closing button
if the ad is closed automatically after a predefined timeout.
on_error
: the function that is set for this parameter will be triggered when there is an error preventing the ad delivery (unsupported environment, user consent conditions, network errors, rendering errors ...).
The JavaScript Functions have to be defined before you initialize the Ogury Tag.
Integration Example - Tag Based
Callback Arguments
For on_ad_show
and on_position_change
, a positionState String value will be returned as argument of these functions.
When calling the functions configured for on_ad_show
, on_no_ad
, on_ad_complete
and on_error
an Ad Unit JavaScript Object will be returned as argument of these functions.
Ad Unit Object - Tag Based:
Note that some parameters are optional (defined with ?
) and may not be available if they are not configured for the Ogury Tag.
For on_ad_show and on_ad_complete,
an adResponseContext
argument provides more details on the shown ad.
adResponseContext Object:
Note that callbacks can be also added in passback configuration (see below)
Stopping the tag execution
In some scenarios you might need to stop the tag execution and stop the ad request, for instance when handling mobile vs. desktop traffic or when certain elements such as other video players are present on the page.
Example
Passback configuration
It is possible to implement a client side waterfall using the passback configuration. Particularly, you may setup a Passback Object configuration to chain ad requests for distinct ad units.
A typical usage is to target an ad unit with a higher price and another one with a lower price afterwards. A waterfall involving these ad units allows to optimize your monetization and your fill rate.
When the first ad unit will have nothing to serve or fires an error, the tag will check if a passback ad unit has been configured. If yes, the tag will request an ad for the passback ad unit that has been configured.
Passback Object
Note that only ad_unit_id field is mandatory, all others params will be by default inherited from initial ad unit configuration if they are not redefined in passback object.
Ad unit object containing passback configuration:
Complete Example - Tag Based:
You need to replace $OGURY_AD_UNIT_PASSBACK
by the value you received during the configuration in the platform.
The passback ad unit configuration will have by default, inherited configuration of the initial ad unit. It is possible to override it with a new configuration
If you already have a video unit in place, ask your Publisher Manager to create a second Ad Unit or do so by yourself in the Publisher Cloud. Update your existing tag with passback configuration for the new ad unit.
If you don't use the Thumbnail yet, ask your Publisher Manager to create the necessary Assets and Ad Units, insert them into the tag above and integrate it in your website.
Managing overlaps
You may have elements in your web page that need to be temporarily displayed above the Footer Ad in order to allow interactions with the users (i.e, menus, modals ...). In that case you should trigger custom Javascript events that would bring the Footer Ad to background and then to foreground again.
Example
Let's consider the case where you have a page menu identified by burger-menu-id
. You should include code similar to the following in your menu handling function in order to send the Footer Ad to the background.
Afterwards, you should bring the Footer Ad back to foreground as follows:
If the Footer Ad creative is a video, it will stop playing on ogy_hide
event and resumed on ogy_show
.
Please make sure you properly use the events described above as they may impact the viewability and the performance of the ads on your web pages.
Last updated