Skip to main content
Gravity serves the ad formats below. The format depends on the ad, on what your client can draw, and on the ad units of the placement. You choose where an ad goes with placements. All formats carry a “Sponsored” label and use the same tracking URLs (impUrl and clickUrl).

Text

The base format, and the fallback for every other one. When a richer format doesn’t apply (for example, the ad has no image), Gravity sends a text ad. The text unit is always on for every placement. If you draw ads with your own component, set supportsSpec: false and enableFrames: false in the Gravity options so you get only text ads. See Show an ad with your own component.

Server-rendered design

Gravity sends a layout for the placement in the ad’s renderer_spec field, and the SDK draws it. Gravity can change the design of a placement without a code change or an SDK upgrade on your side.
  • Supported clients: GravityAd in React and React Native, SpecAdView on iOS, and SpecAd on Android. The SDKs tell Gravity that they can draw designs, so you don’t set anything.
  • Fallback: if the design isn’t compatible with the client, the SDK shows a built-in card.
  • Custom design: in the dashboard, this format is the Custom design unit (designer). It covers Gravity’s server-rendered designs, such as an underlined link, an inline bar, or a card, and any design set up for your placement. To get a design made for your placement, email support@trygravity.com.
See Server-rendered ads for setup on each platform.

Image

When an ad has a brand image, Gravity can send an image layout: the image above the copy (the Image top unit, image_top) or beside it (the Image beside unit, image_side). Image beside puts the image on the left or the right, and Gravity selects the side. Gravity selects the layout for each publisher. Ads without an image use the text format. Image ads need a client that draws server-rendered designs: @gravity-ai/react 1.3.0, @gravity-ai/ui 0.3.0, @gravity-ai/react-native 0.2.0, or later. Older versions show the text format. To preview it, send a test request with testAdFormat: "image" and alwaysReturn: true. Add adLayout (image_left, image_right, or image_top) to see one layout. See Image ads.

Rich frame

A rich frame is an interactive creative that Gravity hosts for the advertiser. The SDK shows it in a sandboxed iframe (sandbox="allow-scripts") in your slot. The ad response has a render object that tells the SDK which frame to load.
  • Supported clients: web only. On your server, @gravity-ai/api sends supportsFrames: true for you (the enableFrames option, on by default). In the browser, GravityAd from @gravity-ai/react and the @gravity-ai/ui components show the frame.
  • Not supported: the iOS, Android, React Native, and Python SDKs can’t show frames. The iOS, Android, and Python SDKs don’t send supportsFrames, so they never get a rich frame. A React Native app requests ads on your server with @gravity-ai/api, which sends supportsFrames: true by default, so set enableFrames: false there. See React Native SDK.
  • Fallback: when the request can’t get a frame, Gravity sends another format that the placement allows, or a text ad.
  • Availability: Gravity serves rich frames only where it has turned them on. A placement that has the unit turned on can still get other formats.
To preview it, send a test request with testAdFormat: "iframe", supportsFrames: true, and alwaysReturn: true. See testAdFormat. A carousel is a row of 3 to 10 product cards that the user scrolls, with a short intro line above them. Each card comes from an ad with a product image. The carousel counts as one impression, and each card has its own click URL.
  • Supported clients: GravityAd from @gravity-ai/react only. A carousel is a Gravity frame, so it needs supportsFrames: true and a web client, the same as a rich frame. @gravity-ai/ui opens the same link for every card, so if your client uses it, don’t turn on the Carousel unit for its placements. Native and Python clients can’t show a carousel.
  • Fallback: when the auction has fewer than three product ads with images, or the request can’t show frames, Gravity sends another format, for example an image ad or a text ad.
  • Style: in the dashboard, next to the Carousel unit, select Edit style to set the theme (Auto, Light, Dark, or Custom colors) and the font of the carousel for that placement.
  • Availability: Gravity serves carousels only where it has turned them on. Gravity can also test the carousel against other formats on the same placement, so a placement with the unit turned on can still get other formats.