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. If you draw ads with your own component, setsupportsSpec: 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: 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 beside the copy or above it. 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.
Lead form
Some campaigns use a lead form: the ad collects the user’s contact details and sends them to the advertiser. The ad response then has aleadForm object.
GravityAd draws the form. To let it submit leads, pass the API key and the session ID of the ad request:
apiKey prop is visible in the browser. Send it from your server with the ad response. See Lead form ads.
To preview it, send a test request with testAdFormat: "lead_form". Gravity doesn’t store leads from the sample form.