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. Thetext 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’srenderer_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:
GravityAdin React and React Native,SpecAdViewon iOS, andSpecAdon 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.
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/apisendssupportsFrames: truefor you (theenableFramesoption, on by default). In the browser,GravityAdfrom@gravity-ai/reactand the@gravity-ai/uicomponents 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 sendssupportsFrames: trueby default, so setenableFrames: falsethere. 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.
testAdFormat: "iframe", supportsFrames: true, and alwaysReturn: true. See testAdFormat.
Carousel
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:
GravityAdfrom@gravity-ai/reactonly. A carousel is a Gravity frame, so it needssupportsFrames: trueand a web client, the same as a rich frame.@gravity-ai/uiopens 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.