Installation
- Bundle
- CDN
despia("appsflyer://log_event?..."). Standard af_ prefixed events are automatically mapped to Meta and TikTok conversion events based on your dashboard partner configuration. Custom events appear only in AppsFlyer for funnel and retention analysis.
event_values must always be a JSON stringified and URI encoded object. Always use encodeURIComponent(JSON.stringify(...)). Event names are case-sensitive. Use only lowercase alphanumeric characters and underscores. There is a limit of 300 unique event names per day.Standard AF Events
These events use theaf_ prefix and are automatically mapped to Meta and TikTok conversion events. Use them for any action you want to optimize ad campaigns against.
af_complete_registration
Records when a user completes sign up. Maps to MetaCompleteRegistration and TikTok CompleteRegistration.
Sign up method used, e.g.
"email", "facebook", "google", "apple"af_login
Records when a user logs in.Login method used, e.g.
"email", "facebook", "google", "apple"af_purchase
Records a purchase and associates revenue. Maps to MetaPurchase and TikTok CompletePayment. The most important event for ROAS optimization.
Total purchase amount. Counted as real revenue in AppsFlyer. No commas, currency signs, or text. Supports up to 5 decimal places. Use negative values for refunds.
3-character ISO 4217 code, e.g.
"USD", "EUR", "AED". Defaults to "USD" if omitted.ID of the purchased item or product, e.g.
"pro_plan", "sku_123"Category of the purchased item, e.g.
"subscription", "course", "item"Number of items purchased
Your internal order ID for deduplication
af_start_trial
Records the start of a free trial. Maps to MetaStartTrial and TikTok Subscribe.
Price of the trial. Use
af_price not af_revenue here. af_price is not counted as revenue and is the correct parameter for Meta’s StartTrial mapping.3-character ISO 4217 code. Defaults to
"USD" if omitted.af_subscribe
Records a paid subscription purchase. Maps to MetaSubscribe and TikTok Subscribe.
Subscription price per period. Not counted as revenue. Use
af_revenue if you also want to record this as revenue in AppsFlyer.3-character ISO 4217 code. Defaults to
"USD" if omitted.ID of the subscription plan, e.g.
"pro_monthly", "annual_plan"af_add_to_cart
Records when a user adds an item to their cart. Maps to MetaAddToCart and TikTok AddToCart.
ID of the item added to cart
Category of the item
Price of the individual item. Not counted as revenue.
3-character ISO 4217 code. Defaults to
"USD" if omitted.Quantity added to cart
af_initiated_checkout
Records when a user begins the checkout flow. Maps to MetaInitiateCheckout and TikTok InitiateCheckout.
Total cart value at checkout. Counted as revenue if included.
3-character ISO 4217 code. Defaults to
"USD" if omitted.Total number of items in the cart
Identifier for the checkout session or cart
af_content_view
Records when a user views a piece of content. Maps to MetaViewContent and TikTok ViewContent.
ID of the content viewed, e.g. a product ID, profile ID, or article ID
Category of the content, e.g.
"product", "article", "collection"Price associated with the content if applicable
3-character ISO 4217 code. Defaults to
"USD" if omitted.af_search
Records a search event. Maps to MetaSearch and TikTok Search.
The search query entered by the user
af_share
Records when a user shares content.Platform shared to, e.g.
"instagram", "whatsapp", "twitter"af_invite
Records when a user sends an invite or referral.Channel the invite was sent through, e.g.
"sms", "email", "whatsapp"af_tutorial_completion
Records when a user completes a tutorial or onboarding step. Maps to MetaCompleteTutorial.
Whether the tutorial was completed successfully
Name or identifier of the tutorial step
af_level_achieved
Records when a user reaches a new level. Maps to MetaAchieveLevel and TikTok AchieveLevel.
The level number achieved
Custom Events
These events do not map to Meta or TikTok but appear in your AppsFlyer dashboard for funnel and retention analysis. Name them anything using lowercase alphanumeric characters and underscores.profile_created
How the profile was created, e.g.
"email", "google", "apple"onboarding_step
Step number in the onboarding flow
Name of the step, e.g.
"select_interests", "upload_photo"onboarding_complete
Number of onboarding steps the user skipped
Total time to complete onboarding in seconds
subscription_start
Plan name, e.g.
"pro", "basic", "annual"Whether the subscription started with a trial period
Price of the plan
referral_sent
The referral code sent
Channel used, e.g.
"whatsapp", "sms", "email"streak_achieved
Number of consecutive days in the streak
content_viewed
ID of the content item
Type of content, e.g.
"episode", "article", "video"post_liked
ID of the post that was liked
ID of the user who created the post
video_completed
ID of the video that was completed
Duration of the video in seconds
feature_used
Name of the feature used, e.g.
"dark_mode", "notifications", "filters"Frequently Asked Questions
What is the difference between af_price and af_revenue?
What is the difference between af_price and af_revenue?
af_revenue is counted as real revenue in AppsFlyer and reported in your dashboard and raw data. Use it for actual purchases. af_price is a monetary value that is NOT counted as revenue. Use it for events like af_add_to_cart or af_start_trial where you want to pass a price but not record revenue. For Meta’s StartTrial mapping specifically, use af_price not af_revenue.Do I need to map events in the AppsFlyer dashboard?
Do I need to map events in the AppsFlyer dashboard?
For standard
af_ events, AppsFlyer maps them automatically to Meta and TikTok. For custom events, you need to add them manually in Configuration > Integrated Partners > [Partner] > In-App Events if you want them postbacked to partners.Can I send multiple items in a single purchase event?
Can I send multiple items in a single purchase event?
Yes. Use
af_content_list with a stringified array of IDs and af_content with a stringified array of objects each containing id and quantity. Do not include af_content_id in the same event when using af_content_list.How do I record a refund or cancellation?
How do I record a refund or cancellation?
Fire an
af_purchase event with a negative af_revenue value and a custom event name like cancel_purchase:Resources
NPM Package
Install the Despia SDK
AF Events Reference
Full list of standard AppsFlyer events and parameters
In-App Events Overview
Revenue, currency, and deduplication rules
Support
Contact our support team