> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trygravity.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ad formats

> The ad formats Gravity serves to AI platforms, what each looks like, and how to show it.

Gravity serves four ad formats. The format depends on the ad and on what your client can draw, and the official SDK components draw all of them. You choose where an ad goes with [placements](https://docs.trygravity.com/ai-platforms/placements.md).

| Format | What it looks like | What you need |
| - | - | - |
| [Text](#text) | Brand, headline, ad text, and a call to action | Nothing. Every client can show it. |
| [Server-rendered design](#server-rendered-design) | A layout that Gravity manages for the placement, such as a card | An official SDK component |
| [Image](#image) | A text ad with the brand image beside or above the copy | An official SDK component, and an ad with an image |
| [Lead form](#lead-form) | A form that collects the user's contact details for the advertiser | `GravityAd` with an API key and the session ID |

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, set `supportsSpec: false` and `enableFrames: false` in the `Gravity` options so you get only text ads. See [Show an ad with your own component](https://docs.trygravity.com/ai-platforms/show-ads.md#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:** to get a design made for your placement, email [support@trygravity.com](mailto:support@trygravity.com).

See [Server-rendered ads](https://docs.trygravity.com/sdks/server-rendered-ads.md) for setup on each platform.

## 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](https://docs.trygravity.com/engine/contextual-ads.md#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 a `leadForm` object.

`GravityAd` draws the form. To let it submit leads, pass the API key and the session ID of the ad request:

```tsx theme={null}
<GravityAd ad={ad} sessionId={sessionId} apiKey={gravityApiKey} />
```

The `apiKey` prop is visible in the browser. Send it from your server with the ad response. See [Lead form ads](https://docs.trygravity.com/ai-platforms/show-ads.md#lead-form-ads).

To preview it, send a test request with `testAdFormat: "lead_form"`. Gravity doesn't store leads from the sample form.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.