Event Tracking
Overview
Section titled “Overview”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.
Tracking events
Section titled “Tracking events”TraceAndroid.trackEvent( name = "purchase_completed", properties = mapOf( "value" to "49.99", "currency" to "USD", "product_id" to "SKU_123" ))TraceClient.shared.trackEvent( name: "purchase_completed", properties: [ "value": "49.99", "currency": "USD", "product_id": "SKU_123" ])Event naming
Section titled “Event naming”Use snake_case for event names. Keep them specific and consistent:
| Good | Avoid |
|---|---|
purchase_completed | Purchase |
signup_email | user signed up |
tutorial_step_3 | step3 |
subscription_started | sub |
Properties
Section titled “Properties”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" ))Recommended events
Section titled “Recommended events”These events help you measure campaign ROI:
| Event | When to track | Key properties |
|---|---|---|
signup_completed | User creates an account | method (email, google, apple) |
onboarding_completed | User finishes onboarding | steps_completed |
purchase_completed | Successful purchase | value, currency, product_id |
subscription_started | Subscription begins | plan, billing, trial |
invite_sent | User invites someone | channel (sms, email, link) |
How it works
Section titled “How it works”- Your app calls
trackEvent() - The SDK sends the event to Trace with the install ID
- Trace associates the event with the original install and its attribution
- 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.