Events Reference
Track user actions and forward them to ad networks for conversion optimization.
Event Types#
AppRefer processes two types of events:
| Type | Source | Use Case |
|---|---|---|
| SDK events | trackEvent() in your app code | Custom actions: sign_up, tutorial_complete, level_complete, etc. |
| RevenueCat webhook events | RevenueCat server-to-server | All purchase and subscription lifecycle events (no app code needed) |
SDK Event Tracking#
// Standard event
await AppReferSDK.trackEvent('sign_up');
// Event with revenue
await AppReferSDK.trackEvent('purchase', params: {
'revenue': '9.99',
'currency': 'USD',
});
// Custom event
await AppReferSDK.trackEvent('tutorial_complete');Standard Event Names#
| Event Name | Description |
|---|---|
| install | Automatically tracked on first SDK configure() |
| sign_up | User creates an account |
| start_trial | User starts a free trial |
| subscribe | User subscribes to a plan |
| purchase | User makes a purchase |
| add_to_cart | User adds item to cart |
| initiate_checkout | User begins checkout flow |
| search | User performs a search |
| view_content | User views a product or content page |
| tutorial_complete | User completes onboarding tutorial |
| level_complete | User completes a game level |
Custom Events
Revenue Events#
Include revenue and currency parameters to report revenue to ad networks. Revenue values should be strings representing decimal amounts (e.g., "9.99"). Currency should be a 3-letter ISO 4217 code (e.g., "USD").
Ad Network Event Mapping#
| AppRefer Event | Meta CAPI | Google Ads | TikTok |
|---|---|---|---|
| install | Lead | (gclid required) | Lead |
| purchase | Purchase | purchase | Purchase |
| sign_up | CompleteRegistration | sign_up | CompleteRegistration |
| start_trial | StartTrial | start_trial | StartTrial |
| qualified_trial | StartTrial | qualified_trial | StartTrial |
| subscribe | Subscribe | subscribe | Subscribe |
| add_to_cart | AddToCart | add_to_cart | AddToCart |
| view_content | ViewContent | view_content | ViewContent |
Event Deduplication#
Each forwarded event includes a unique identifier per network to prevent duplicate conversions. Deduplication is handled automatically — no additional configuration needed.
Advanced Matching#
Call setAdvancedMatching() after user login to enrich forwarded events with hashed PII. This improves ad network match rates by 20-30%.
AppReferSDK.setAdvancedMatching(
email: 'user@example.com',
phone: '+14155551234',
);All PII is SHA256-hashed on the device before being sent to the server. See the Privacy page for details on data handling.