gr-pix.js) is a required install on your site. It captures attribution context so Gravity can tie ad impressions and clicks back to real outcomes — without it, we can’t measure performance or pay you.
Web install
Drop this snippet on every page — ideally in your base template / layout:YOUR_PIXEL_ID in your dashboard under Settings → Platform Settings. It’s a UUID.
Verify it’s firing
- Load any page with the pixel installed.
- Open your browser DevTools → Network tab and look for a request to
api.trygravity.ai/track/gr-events. - A
200response means the pixel is firing correctly. Events typically appear in your dashboard within ~10 minutes.
In-app browser (WebView)
If your app opens Gravity ad links inside an in-app WebView rather than the system browser, install the pixel inside the WebView too with theinAppBrowser: true flag. This preserves attribution when a user clicks an ad and lands on the advertiser’s page inside your app.
Swift (iOS / iPadOS)
React Native
Flutter
Troubleshooting
Pixel doesn't fire on a web page
Pixel doesn't fire on a web page
- Make sure the script loads last in the document (before
</body>). - Check DevTools Network tab for a request to
code.trygravity.ai/gr-pix.js. - Check the console for errors. If another script throws before the pixel runs, the pixel load order may need adjusting.
Pixel fires but events don't show in dashboard
Pixel fires but events don't show in dashboard
- Confirm
YOUR_PIXEL_IDmatches the Pixel ID in Settings → Platform Settings. It’s separate from your API key. - Check DevTools Network for
api.trygravity.ai/track/gr-eventsPOST requests. A 200 response means we got it; dashboard updates within ~10 minutes.
WebView events not arriving
WebView events not arriving
- iOS WebKit needs
WKWebsiteDataStore.default()(the default)..nonPersistentDataStore()breaks cookie persistence. - Verify
injectionTime/onPageFinishedactually fires —console.logfrom inside the injected script and capture viaWKScriptMessageHandler(Swift) oronMessage(RN).
Next
Going live
Final checklist before flipping
production: true.
