NitroAdOptions
interface NitroAdOptions {
acceptable?: boolean;
anchor?: AnchorPositionOptions;
anchorBgColor?: string;
anchorClose?: boolean;
anchorCloseBg?: string;
anchorCloseColor?: string;
anchorPersistClose?: boolean;
anchorStickyOffset?: number;
articleOffsetTop?: number;
bidders?: string[];
className?: string;
contentRating: string;
delayLoading?: boolean;
demo?: boolean;
demoDelay?: number;
floating?: FloatingOptions;
format: FormatOptions;
frequencyCap?: number;
geoAllow?: string[];
geoDeny?: string[];
height?: number;
interstitial?: InterstitialOptions;
keywords?: string;
mediaQuery?: string;
onNavigateMin?: number;
outstream?: OutstreamOptions;
pageInterval?: number;
placeholderColor?: string;
rail?: string;
railCloseColor?: string;
railCollisionWhitelist?: string[];
railDistance?: number;
railOffsetBottom?: number;
railOffsetTop?: number;
railSpacing?: number;
railStack?: boolean;
railStickyTop?: number;
railVerticalAlign?: RailVerticalAlignOptions;
refreshDisabled?: string[];
refreshLimit?: number;
refreshTime?: number;
refreshVisibleOnly?: boolean;
renderVisibleOnly?: boolean;
resultTimeout?: number;
sizes: [number, number][];
skipBidders?: string[];
skipPrebid?: boolean;
smartFlexStickyTop?: number;
stickyStackLimit?: number;
stickyStackOffset?: number;
stickyStackResizable?: boolean;
stickyStackSpace?: number;
targeting: PlacementTargeting;
title?: string;
visibleMargin?: number;
}Placement options
Properties
acceptable: boolean
Set this to create an acceptable ads placement. Default is false.
No longer used. Any ad placements with this defined will be ignored.
anchor: AnchorPositionOptions
Used with anchor format to specify if anchor should be at the top or bottom of screen. Defaults is bottom.
anchorBgColor: string
Used with anchor format to define the background color. Default is rgb(0 0 0 / 80%)
anchorClose: boolean
Used with anchor format to toggle whether or not an anchor can be closed. Default is false, meaning close button will not be present
anchorCloseBg: string
Used with anchor format to define the background color of the close button. Default is rgba(255, 255, 255, 0.2)
anchorCloseColor: string
Used with anchor format to define the close button color. Default is #fff
anchorPersistClose: boolean
Used with anchor to specify that the close action should be persistent for the entire browser session. Default is false, meaning clicking on close will only close the anchor for the current page.
anchorStickyOffset: number
Used with anchor format to specify the amount of space (in pixels) between the ad and the edge of the screen.
articleOffsetTop: number
Used with article format to specify the amount of space (in pixels) between the ad and the top of the screen when it's sticky.
bidders: string[]
Mutually exclusive with skipBidders (skipBidders has priority). List of bidders to include in auction.
className: string
Used with formats that generate ad placements on the page without static holders to provide css selectors.
contentRating: string
Used to filter demand by content safety.
delayLoading: boolean
Delay loading until DOMContentLoaded. Recommended only for responsive placements when external stylesheets must be loaded first to determine size. This delays the start of ad auction, which may slightly reduce ad performance. Default is false.
demo: boolean
Display a static placeholder instead of making ad calls, for testing.
demoDelay: number
Time to wait (in milliseconds) before rendering demo placement.
floating: FloatingOptions
Settings for floating format.
format: FormatOptions
Placement format. Default is display.
frequencyCap: number
Duration in seconds for per-user frequency cap. If set, this placement will only be shown to the user every frequencyCap seconds.
geoAllow: string[]
Array of 2-letter country/region codes. If set, this placement will only be shown to users in these regions. In addition to ISO 3166-1 alpha-2 codes, 'XX' is unknown, and 'T1' is tor users.
geoDeny: string[]
Array of 2-letter country/region codes. If set, this placement will not be shown to users in these regions. In addition to ISO 3166-1 alpha-2 codes, 'XX' is unknown, and 'T1' is tor users.
height: number
Sets a fixed height (in pixels) on the placement's holder div if not already set. When specified, available sizes are derived from this height rather than the holder's rendered dimensions.
interstitial: InterstitialOptions
Options for interstitial placements.
Example
interstitial: {
triggers: {
unhideWindow: true,
},
},keywords: string
Comma separated list of keywords describing the page. Use this to override the site keywords setting for placements on specific parts of site. Example: 'video games, fps, doom'.
mediaQuery: string
Specifies an optional media query that must be matched for an ad placement to display.
onNavigateMin: number
The minimum amount of milliseconds to wait since initialization or the last refresh until NitroAd.onNavigate() is allowed to trigger a refresh
outstream: OutstreamOptions
Outstream video support. Default is 'auto'.
pageInterval: number
Optional parameter used with article format to specify how many pages of content should appear between ad placements. Defaults to 1.
placeholderColor: string
Used with smart-flex format to specify the color of the pre-ad loader and the blank placeholder.
rail: string
Used with rail format to specify if the rail should be placed on the left or right side of the screen. Default is left.
railCloseColor: string
Used with rail format to specify the color of the rail close button. Default is rgb(102 102 102)
railCollisionWhitelist: string[]
Used with rail format to specify any elements that should be ignored when detecting collisions for the rail. These can be class names (.className) or ids (#id). The wildcard * can be used to ignore all collisions.
railDistance: number
Used with rail format to specify the amount of total amount of pixels the side rail will scroll with the user, set 0 for as far as possible.
railOffsetBottom: number
Used with rail format to specify the amount of pixels between the bottom of the page and where the ad stops scrolling.
railOffsetTop: number
Used with rail format to specify the amount of pixels between the top of the page and where the ad is initially positioned. The ad becomes sticky after scrolling for the given distance.
railSpacing: number
Used with rail format to specify the amount of pixels between the ad and the left/right edge of the screen. Default is 10.
railStack: boolean
Used with rail format to stack two ads in the rail. If true, the sizes option will be filtered to only include sizes 300x250, 320x50 and/or 320x100. Default is false.
railStickyTop: number
Used with rail format to specify the amount of pixels between the top of the screen and where the ad becomes sticky.
railVerticalAlign: RailVerticalAlignOptions
Used with rail format to specify the vertical alignment of the rail ad. Can be center (default) or top
refreshDisabled: string[]
List of bidders for whom refreshing should be disabled. If specified, refreshing will be stopped when one of these is filled.
refreshLimit: number
The maximum number of times an ad placement can be refreshed per page view.
refreshTime: number
The amount of time in seconds that must pass before another auction is run and the placement renders a new ad.
refreshVisibleOnly: boolean
Only refresh when placement is in view. Default is true.
renderVisibleOnly: boolean
Delay initial ad rendering until the placement's dom element is about to enter view. visibleMargin can be used to adjust how much buffer margin is used.
resultTimeout: number
Maximum time in milliseconds between nitroAds.adRequested and nitroAds.adResult for this placement, not counting time the request spends deferred. If no outcome arrives in time, nitroAds.adResult fires with status timeout. Default is 5000 (15000 for video and video-nc), minimum is 1000.
sizes: [number, number][]
List of valid sizes for placement. Sizes should be specified as [x, z].
skipBidders: string[]
Mutually exclusive with bidders (skipBidders has priority). List of bidders to be excluded from auction.
skipPrebid: boolean
If true, the auction will not include any Prebid demand
smartFlexStickyTop: number
Used with smart-flex format to specify the amount of pixels between the top of the screen and where the ad becomes sticky.
stickyStackLimit: number
Used with sticky-stack format to specify the maximum amount of ads that will be rendered in the column. If the maximum is reached, the final ad will scroll with the user until the end of page without creating any additional units.
stickyStackOffset: number
Used with sticky-stack format to specify the amount of space (in pixels) between the ad and the top of the screen when it's sticky, and also the space in between ads that are swapping.
stickyStackResizable: boolean
Used with sticky-stack format to specify if the stack should add more placements if more space becomes available. Default is false.
stickyStackSpace: number
Used with sticky-stack format to specify the amount of space between ad units as a multiple of the total viewport height (minimum 1.25)
targeting: PlacementTargeting
Optional placement targeting information. This can be used to specify tags such as content category or other values which can be used for ad unit targeting. The key must be a string, and the value can be a single string or number. Support for arrays is deprecated and not reportable.
Example
targeting: {
key: 'value',
location: 'top',
},title: string
Override default title attribute of placement iframe.
visibleMargin: number
The off-screen margin in pixels, used to determine when a placement is about to enter view. Default is 200.