Integrations
Meta (Facebook) ads
Horse reports sales to Meta from the server, through the Conversions API: trials, first payments, trial conversions and every renewal, for as long as the person stays. The app can't see most of that. Meta matches each sale to the ad that brought the person in.
#Who reports what
| Event | Reported by |
|---|---|
| App installs and activations, your funnel events (registration, content viewed, checkout started…) | The app, with Meta's SDK |
| Trial started, first purchase, trial converted, renewals, one-time purchases | Horse, never the app |
#In the app
Turn off Meta's automatic purchase logging
In
Info.plist, so the Meta SDK stops logging StoreKit purchases by itself:<key>FacebookAutoLogAppEventsEnabled</key> <false/>With it off, log the activation yourself on every
.activescene phase withAppEvents.shared.activateApp(), and log no purchase, trial or subscribe event from the app.Give Horse the ids Meta matches on
Add the HorseKitAttribution library. At launch, and again right after the App Tracking Transparency answer (people can change it in Settings later):
import HorseKitAttribution // After ATTrackingManager.requestTrackingAuthorization(), and at launch: await Horse.shared.collectDeviceIdentifiers() // $idfv, $attConsentStatus, $idfa if allowed await Horse.shared.setFBAnonymousID(AppEvents.shared.anonymousID) // $fbAnonIdStart Meta's SDK first, or its anonymous id is still empty. The tracking prompt needs
NSUserTrackingUsageDescriptioninInfo.plist. Without any of these ids Horse can't send the sale, and it shows as skipped: no device identifier on the Integrations tab.
#In the dashboard
An owner or admin, on the app's Integrations tab:
Dataset and token
From Meta Events Manager, the app's dataset ID and a Conversions API access token (Settings → Conversions API → Generate access token). The token is stored as a secret. Only its last four characters are ever shown again.
Choose what to send
Choose revenue before or after Apple's commission, and the event names (StartTrial, Subscribe and
fb_mobile_purchaseby default; leave one empty to turn it off). Choose whether to also send people who declined tracking (off by default). A separate sandbox dataset is optional. Without one, TestFlight purchases aren't sent.Send a test event
Use the test code from Events Manager → Test events, then check Recent deliveries.
#Good to know
- Never sent: refunds, cancellations, expirations, Family Sharing copies, and anything older than 7 days.
- Moving from another provider that also reports to Meta? Turn its Meta integration off in the same sitting you turn Horse's on. While both run, each renewal reaches Meta twice.
- If you import an app's purchase history into Horse, turn the Meta integration on after the import. An import replays the last 7 days, and those sales would reach Meta a second time.