Skip to content

Event Tracking

Event tracking lets you measure what users do after installing your app. By tracking key actions (purchases, signups, subscriptions), you can tie conversions back to the campaign that drove the install.

TraceAndroid.trackEvent(
name = "purchase_completed",
properties = mapOf(
"value" to "49.99",
"currency" to "USD",
"product_id" to "SKU_123"
)
)

Use snake_case for event names. Keep them specific and consistent:

GoodAvoid
purchase_completedPurchase
signup_emailuser signed up
tutorial_step_3step3
subscription_startedsub

Properties are key-value pairs of strings. Use them to add context to events:

TraceAndroid.trackEvent(
name = "subscription_started",
properties = mapOf(
"plan" to "pro",
"billing" to "annual",
"trial" to "true"
)
)

These events help you measure campaign ROI:

EventWhen to trackKey properties
signup_completedUser creates an accountmethod (email, google, apple)
onboarding_completedUser finishes onboardingsteps_completed
purchase_completedSuccessful purchasevalue, currency, product_id
subscription_startedSubscription beginsplan, billing, trial
invite_sentUser invites someonechannel (sms, email, link)
  1. Your app calls trackEvent()
  2. The SDK sends the event to Trace with the install ID
  3. Trace associates the event with the original install and its attribution
  4. You can now answer: “How many purchases came from my summer campaign?”

Events are linked to installs via the install ID that was assigned during attribution. This happens automatically — you don’t need to pass any attribution data when tracking events.