Skip to main content

Response Renderers

The Ad Placement API response JSON contains the zones array and the renderers and user objects.

In this page we will explain the renderers object, which can be employed to independently render different containers and ads on your webpage.

Container Renderers

These renderers are designed to generate various types of containers where you can conveniently display the ads. The render function of the container renderers will return an array with the placeholders that you can use to place the ads.

As for the zone object, you can pass the same object you received in the Ad Placement response, with the difference that you do not need to pass the zones.type.

Fixed Container Renderer

Used to render a container with a fixed position on the page.

This script will expose the window.FixedContainerRenderer variable, which you can use to interact with the renderer. For example, by calling window.FixedContainerRenderer.render(zone, placeholder); it is possible to render the container on the page.

Available renderer functions:

FunctionParameter NamesRequiredParameter Description
render()zoneYesZone object containing information for rendering
placeholderYesHTML element indicating where to render the container
cookieConsentNoBoolean indicating if the user consents to cookies

Sticky Container Renderer

This script will expose the window.StickyContainerRenderer variable, which you can use to interact with the renderer. For example, by calling window.StickyContainerRenderer.render(zone, placeholder); it is possible to render the container on the page.

Available renderer functions:

FunctionParameter NamesRequiredParameter Description
render()zoneYesZone object containing information for rendering
placeholderYesHTML element indicating where to render the container
cookieConsentNoBoolean indicating if the user consents to cookies
setBorder()zoneIdYesID of the zone to set the border for
widthYesWidth of the border
colorYesColor of the border
removeBorder()zoneIdYesID of the zone to remove the border from
setPosition()zoneIdYesID of the zone to set the position for
horizontalPositionYesHorizontal position of the zone
verticalPositionYesVertical position of the zone

Instant Message Container Renderer

Used to render a instant message container on the page.

This script will expose the window.InstantMessageContainerRenderer variable, which you can use to interact with the renderer. For example, by calling window.InstantMessageContainerRenderer.render(zone, placeholder); it is possible to render the container on the page.

Available renderer functions:

FunctionParameter NamesRequiredParameter Description
render()zoneYesZone object containing information for rendering
placeholderYesHTML element indicating where to render the container
cookieConsentNoBoolean indicating if the user consents to cookies

Mobile Instant Message Container Renderer

Used to render a instant message container for mobile on the page.

This script will expose the window.MobileInstantMessageContainerRenderer variable, which you can use to interact with the renderer. For example, by calling window.MobileInstantMessageContainerRenderer.render(zone, placeholder); it is possible to render the container on the page.

Available renderer functions:

FunctionParameter NamesRequiredParameter Description
render()zoneYesZone object containing information for rendering
placeholderYesHTML element indicating where to render the container
cookieConsentNoBoolean indicating if the user consents to cookies

Fullpage Interstitial Container Renderer

Used to render a fullpage interstitial container for desktop or mobile on the page.

This script will expose the window.FullpageInterstitialContainerRenderer variable, which you can use to interact with the renderer. For example, by calling window.FullpageInterstitialContainerRenderer.render(zone, placeholder); it is possible to render the container on the page.

Available renderer functions:

FunctionParameter NamesRequiredParameter Description
render()zoneYesZone object containing information for rendering
placeholderYesHTML element indicating where to render the container
cookieConsentNoBoolean indicating if the user consents to cookies

Group Container Renderer

This script will expose the window.GroupContainerRenderer variable, which you can use to interact with the renderer. For example, by calling window.GroupContainerRenderer.render(group, placeholder); it is possible to render the container on the page.

Available renderer functions:

FunctionParameter NamesRequiredParameter Description
render()groupYesGroup object containing information for rendering
placeholderYesHTML element indicating where to render the container
cookieConsentNoBoolean indicating if the user consents to cookies

Content Renderers

These renderers are responsible for displaying the ads within a container. Some are self-contained and do not require a container.

This script will expose the window.BannerRenderer variable, which you can use to interact with the renderer. For example, by calling window.BannerRenderer.render(zone, placeholder); it is possible to render the ad.

Available renderer functions:

FunctionParameter NamesRequiredParameter Description
render()zoneYesZone object containing information for rendering
placeholderYesHTML element indicating where to render the ad, such as a container
cookieConsentNoBoolean indicating if the user consents to cookies

Native Content Renderer

This script will expose the window.NativeRenderer variable, which you can use to interact with the renderer. For example, by calling window.NativeRenderer.render(zone, placeholder); it is possible to render the ad.

Available renderer functions:

FunctionParameter NamesRequiredParameter Description
render()zoneYesZone object containing information for rendering
placeholderYesHTML element indicating where to render the ad, such as a container
cookieConsentNoBoolean indicating if the user consents to cookies

Outstream Video Content Renderer

This script will expose the window.OutstreamVideoRenderer variable, which you can use to interact with the renderer. For example, by calling window.OutstreamVideoRenderer.render(zone, placeholder); it is possible to render the ad.

Available renderer functions:

FunctionParameter NamesRequiredParameter Description
render()zoneYesZone object containing information for rendering
placeholderYesHTML element indicating where to render the ad, such as a container
cookieConsentNoBoolean indicating if the user consents to cookies

In-Page Push Notification Content Renderer

This script will expose the window.InPagePushNotificationRenderer variable, which you can use to interact with the renderer. For example, by calling window.InPagePushNotificationRenderer.render(zone, placeholder); it is possible to render the ad.

Available renderer functions:

FunctionParameter NamesRequiredParameter Description
render()zoneYesZone object containing information for rendering
placeholderYesHTML element indicating where to render the ad, such as a container
cookieConsentNoBoolean indicating if the user consents to cookies