Native Ads

Request and render OpenRTB 1.2 native ads with the n360ortb library.

The n360ortb library supports OpenRTB 1.2 native impressions alongside banner and video. Native ads are configured on a per-slot basis by adding a native block to the slot definition, and the library returns the parsed native response on the bid so you can either:

  1. Render the ad yourself in the publisher page (asset-based DOM rendering), or

  2. Serve it through Google Ad Manager using native targeting keys + a template creative.

circle-info

Native support was introduced in n360ortb v0.3.0. The library is served from https://lib.nexx360.io/nexx360ortb/api.js.

Slot Configuration

Native slots accept either a Prebid-style shortcut config or a raw OpenRTB 1.2 passthrough.

n360ortb.fetchBids({
  slots: [{
    slotID: 'native-slot-1',
    tagId: 'your-tag-id',
    mediaType: 'native',
    native: {
      title:       { required: true,  len: 80 },
      image:       { required: true,  sizes: [300, 250] },
      icon:        { required: false, sizes: [50, 50] },
      sponsoredBy: { required: true },
      body:        { required: false, len: 200 },
      cta:         { required: true },
      rating:      { required: false }
    }
  }]
}, renderCallback);
Shortcut
Required flag
Maps to OpenRTB asset

title

required

{ title: { len } } (defaults to 140 chars)

image

required

{ img: { type: 3 (main), w, h } } — or wmin/hmin with aspect_ratios

icon

required

{ img: { type: 1 (icon), w, h } }

sponsoredBy

required

{ data: { type: 1 } } (brand name)

body

required, len

{ data: { type: 2 } } (description)

rating

required

{ data: { type: 3 } }

cta

required

{ data: { type: 12 } } (call-to-action text)

clickUrl

required

Not a request asset — returned on link.url.

OpenRTB 1.2 passthrough

If you need full control (event trackers, context/placement type, video assets, custom ext), pass the OpenRTB request directly:

See the Native Configs page for pre-defined configurations (native_config=1, native_config=2) that you can reuse.

circle-info

Set mediaType: 'native' to tell the library the slot is native-only. Without it the library assumes a banner slot and requires sizes.

Bid Response

When a native bid wins, the library parses the native response out of bid.adm (a stringified JSON payload) and exposes it on the returned StoredBid:

Media type is detected from bid.ext.mtype when present (1=banner, 2=video, 4=native), with fallback to JSON-shape probing and VAST sniffing.

Rendering in the Publisher Page

circle-exclamation

Rendering through Google Ad Manager

For GAM-served natives, the library exposes the winning native assets as targeting key-values so your GAM native creative template can reference them via macros.

Native targeting keys

Set only when the winning bid is native. Values longer than 200 chars are replaced with the bidId (sendId pattern) — the creative resolves the full value via the library's __n360_locator__ postMessage path.

Key
Source

n360_mt

Media type: banner, video, or native

n360_native_title

assets[].title.text (truncated to 140 chars)

n360_native_image

assets[].img.url where type=3 (main image)

n360_native_icon

assets[].img.url where type=1 (icon)

n360_native_brand

assets[].data.value where type=1 (sponsored by)

n360_native_body

assets[].data.value where type=2 (description, truncated)

n360_native_rating

assets[].data.value where type=3

n360_native_cta

assets[].data.value where type=12

n360_native_linkurl

link.url

GAM setup

  1. Create a Native ad format in GAM matching the fields above (title, image, brand, body, CTA, clickUrl).

  2. In your native creative, bind each variable to the corresponding n360_native_* key-value (e.g. %%PATTERN:n360_native_title%%).

  3. Target line items on n360_mt = native AND n360_pb >= <your-price-bucket>.

  4. Standard line-item / price-bucket setup follows the same pattern as banner — see Line Item Setup.

See GAM Creative Setup for the general pattern of binding n360_* keys to creative macros.

Complete Example

Last updated

Was this helpful?