Endpoints
Ad Feedback
Let users react to ads with thumbs-up / thumbs-down.
POST
End users can submit feedback on served ads — thumbs up, thumbs down, and optional reasons. This helps Gravity improve ad quality and relevancy over time, and gives publishers a signal for user satisfaction.
Just pass through
Every ad response includes an
Base URL
Headers
Your Gravity publisher API key.
Body
Session identifier. Same value you passed when requesting the ad.
The
impUrl from the ad response object. The server decrypts this to extract the ad’s tracking IDs (grclid, gradid, campaignId, publisherId) automatically — you don’t need to parse or extract anything yourself.User’s reaction. One of
thumbs_up or thumbs_down.Optional. Why the user reacted this way. Array of reason strings. Suggested values:
You can send any string — the values above are suggestions, not an enum.
| Reason | When to use |
|---|---|
not_interested | User doesn’t care about this product/category |
irrelevant | Ad doesn’t relate to the conversation |
offensive | Ad content is objectionable |
repetitive | User has seen this ad too many times |
misleading | Ad claims don’t match the landing page |
helpful | (thumbs up) Ad was useful or well-matched |
Optional. Free-text feedback from the user (max 1,000 characters).
Optional. Placement type where the ad was shown (e.g.
below_response).Optional. Publisher’s slot identifier for the placement.
Optional. Publisher’s end-user identifier.
Optional. Device signals — same shape as the ad request’s
device object.Response
200 — feedback recorded.
401 — invalid API key.
422 — invalid impUrl. The URL could not be decrypted. Make sure you’re sending the exact impUrl from the ad response.
429 — rate limit exceeded. The endpoint allows up to 30 feedback submissions per session per minute.
503 — internal error. Safe to retry.
Best practices
Surface feedback controls after the ad renders
Show a small thumbs-up / thumbs-down UI once the ad is visible. Don’t interrupt the user — feedback should be one tap, not a modal.Collect reasons on thumbs-down
When a user taps thumbs-down, show a quick follow-up with checkboxes or chips fornot_interested, irrelevant, repetitive, offensive. Send the selected reasons in the reasons array. This gives Gravity actionable signal to improve matching.
Don’t gate the experience on feedback
Feedback is fire-and-forget. If the request fails, swallow the error — never block the user’s workflow because a feedback call didn’t land.Just pass through impUrl
Every ad response includes an impUrl. Simply store the ad object and pass ad.impUrl back when submitting feedback — the server handles all the tracking ID extraction automatically. No need to parse URLs or decrypt tokens on the client side.
What’s next
Show ads
Render ads with the pre-built React component or your own UI.
Contextual ads endpoint
Full request / response reference for
POST /api/v1/ad.