revenuecat-ad-tracking
revenuecat-ad-tracking: track ad events in RevenueCat
Use this skill when the user wants their ad revenue and ad impressions reported to RevenueCat. The app keeps its existing ad SDK and mediation. RevenueCat only receives events: loaded, displayed, opened (clicked), revenue, failed to load, and the rewarded-ad funnel.
This is a wiring task across every place the app loads or shows an ad, not a feature you build once. A half-wired integration produces charts that look plausible and are wrong: impressions without revenue, click rates above 100%, fill rates at 0%. Take the time to find every ad call site, confirm what you cannot infer, and verify with sandbox events before you report done.
Prerequisite: Purchases.configure(…) runs before the first ad event is tracked. The rewarded-ad prompt events fire before any ad loads, so configure before showing the prompt too. Before configure, the manual path crashes on iOS, Android and KMP (Purchases.shared / Purchases.sharedInstance throw) and rejects the call on Flutter and React Native. The legacy Android adapter throws too, because loadAndTrack is reached through Purchases.sharedInstance.adTracker. The other adapters check Purchases.isConfigured and skip the event: silently on iOS, with a logged warning on Android Next-Gen, Flutter, React Native and Unity. Access the tracker inside the callbacks, not at construction time. If the app has no RevenueCat setup yet, run integrate-revenuecat first.
0. If the user pasted the dashboard prompt
The Ads page of the RevenueCat dashboard generates a prompt that starts with "Add RevenueCat ad tracking to this … app." and has Context, Task and Verify sections. It states the platform, the mediator, the integration path (adapter or manual), the minimum SDK version and, for Android, the Google Mobile Ads generation. Treat it as the source of truth: do not re-ask what it answers. The prompt has no integration steps of its own; it points back to this skill. Follow the remaining sections and read the matching platform file before you edit code. If the request only resembles the prompt's first line and has no Context section, it is a normal request: run section 1 in full.
1. Gather the facts before writing code
1a. Platform
Inspect the working directory, including subdirectories such as shared/, app/ or apps/*, and pick the first match, from top to bottom: