Description

The @format context query describes information about the ad slot, the configuration and type of format in which the ad is being displayed and the format's current state (i.e. is it an expandable unit, if so what component is showing, etc).

Example Usage

One common usage of the @ad context is to hide and show parts of the ad depending on the kind of format the ad is being displayed as. An example of this would be hiding/showing the appropriate call-to-action button depending on if the ad is an expandable format or not.

.click-through-button {
	display: inline-block;
}

.expand-button {
	display: none;
}

@ad (expandable: true) {
	.click-through-button {
		display: none;
	}
	
	.expand-button {
		display: inline-block;
	}
}
Feature NameJavascript NameValueExample ValueDescription
readyadReadybooleantrueThe ad has fully loaded and all content is ready.
typeadTypein-content out-of-pagein-contentDescribes the type of ad format.
responsiveadResponsivebooleantrueBoolean noting if the ad slot has responsify active.
visible-iabadVisibileIabbooleantrueBoolean noting if the ad slot currently meets IAB requirements for being 'visible'
visibleadVisiblebooleantrueBoolean noting if the ad slot is mostly showing.
visibilityadVisibilitynumber90A number representing the percentage of the ad that is currently in view.
visibility-xadVisibilityXnumber90A number representing the percentage of the ad that is currently in view along the x axis.
visibility-yadVisibilityYnumber90A number representing the percentage of the ad that is currently in view along the y axis.
banner-onlyadBannerOnlybooleantrueA boolean representing if the banner is the only component in the ad besides the loader.
panel-onlyadPanelOnlybooleantrueA boolean representing if the panel is the only component in the ad besides the loader.
current-stateadCurrentStatecollapsed collapsing expanded expandingcollapsedThe name of the current state of the ad.
experienceadExperiencerich staticrichDescribes the capabilities of the ad viewing experience.
expandableadExpandablebooleantrueBoolean noting if the ad can expand into a larger size.
expand-directionadExpandDirectionn ne nw s sw se etcneString noting the direction of the expand as a cardinal direction.
expand-directionsadExpandDirectionsSpace separated list containing any of the following: n e s wnList of strings of all the directions that the expand will move in.
slot-aspect-ratioadSlotAspectRationumber0.56The aspect ratio of the ad slot as calculated by width/height.
publisher-channeladPublisherChannelstringespnA string representing the publisher channel that the ad was trafficked against.
first-interactionadFirstInteractonbooleantrueA boolean that notes if the ad has been interacted with yet.
first-exitadFirstExitbooleantrueA boolean that notes if the user has triggered an exit yet.