/
Sticky Ad Integration

Sticky Ad Integration

As with the Flying Carpet Ad, the Sticky Ad requires an additional script to be loaded in the head of the page:

< script   async  custom-element = "amp-sticky-ad"   src = "https://cdn.ampproject.org/v0/amp-sticky-ad-1.0.js" ></ script >

To use the sticky feature, the normal Ad TAG must be loaded inside the amp-sticky-ad container. Within the Ad TAG, the desired sizes can be defined: 

< amp-sticky-ad   layout = "nodisplay" >
< amp-ad
type = "doubleclick"
data-slot = "/AdserverID/WebPageKey/Channel/ContentTyp/AdPosition" 
width = "320"
height = "150"
data-multi-size = "320x150,300x150,320x100,300x100,320x75,300x75,300x50,320x50"
data-multi-size-validation = "false"
json = '{"targeting":{"ad_position":"<pass ad position value from data-slot>","sitename":"<pass WebpageKey value from data-slot>","channel":"<pass channel value from data-slot>","contenttype":"<pass ContentType value from data-slot>","adkeyword":"<custom value>","pageid":"<pass unique page id >"}}' >
rtc-config='{
"vendors": {
"criteo": {"NETWORK_ID": 6507},
"indexexchange": {"SITE_ID": "xxxxxx"},
"aps": {"PUB_ID": "3690"},
"yieldlab": {"ADSLOT_ID": "xxxxxx"},
"yieldlab": {"ADSLOT_ID": "xxxxxx"}
},
"timeoutMillis": 500}'>
</ amp-ad >
</ amp-sticky-ad >


The style of amp-sticky-ad can be customized with the following CSS classes:

  • amp-sticky-ad

  • amp-sticky-ad-close-button

  • amp-sticky-ad-top-padding

 

Related content