Skip to main content

React

GravityAd handles the placement design, impression and click tracking, disclosure, feedback controls, and fallback automatically. Pass the API key used for the ad request to enable feedback submissions:
apiKey is visible in the browser and used for feedback submissions. Pass it down from your server with the ad response rather than referencing a server-only environment variable in client code.

Multiple placements

The response order matches the placement order in your request. Render each slot only when it fills:

Custom rendering

Use the official component unless you need a fully custom renderer. Custom renderers must:
  1. Open ad.clickUrl, not the raw landing-page URL.
  2. Request ad.impUrl exactly once when the ad becomes visible.
  3. Show a clear ad disclosure.
See the JavaScript and React SDK guide for request setup.