Events and users
Tracking events
Track the funnel and revenue from your app, with consent and offline handling built in.
Track what people do after they install, so you can see which links, channels and creators bring users who sign up, add to cart and buy. Events need the SDK at version 0.2.0 or later.
There are two ways to send an event:
Revenue from your server is the one you can trust: an app can be modified to report purchases that never happened, and a purchase made on your website or renewed by the store never passes through the app. So track the funnel in the app, and send money from your server.
Track an event#
Dropplink.track("add_to_cart", mapOf("sku" to "TSHIRT-M", "qty" to 1, "gift" to false))Dropplink.track("add_to_cart", props: ["sku": "TSHIRT-M", "qty": 1, "gift": false])Dropplink.track('add_to_cart', props: {'sku': 'TSHIRT-M', 'qty': 1, 'gift': false});Dropplink.track('add_to_cart', { props: { sku: 'TSHIRT-M', qty: 1, gift: false } });track returns at once and never throws. Call it from anywhere, including the main thread.
Add revenue#
Attach revenue to the event where money changes hands. The currency is any ISO 4217 code; the dashboard also converts it to rupees at that day's rate.
Dropplink.track("purchase", revenue = Revenue(amount = 499.0, currency = "INR", orderId = "A1023"))Dropplink.track("purchase", revenue: Revenue(amount: 499, currency: "INR", orderId: "A1023"))Dropplink.track('purchase', revenue: Revenue(amount: 499, currency: 'INR', orderId: 'A1023'));Dropplink.track('purchase', { revenue: { amount: 499, currency: 'INR', orderId: 'A1023' } });Already sending purchases from your server?
Then you can leave revenue out of the app event, or keep it there as a second view. App-reported revenue is shown separately and never pays creators, so nothing is counted twice.
Naming events and properties#
In debug mode the SDK logs every event it drops, and why:
Dropplink: event "Add To Cart" dropped: name must be snake_case, e.g. add_to_cartWhat to track#
Start with the few events that tell you whether a link brought a valuable user. You can add more at any time; there's nothing to set up in the dashboard first.
Keep names stable
Pick a name once and keep it. add_to_cart and added_to_cart are two different events in every report, and renaming one later
splits its history in two.
How events are sent#
You don't need to handle networking, retries or being offline:
trackchecks the event, gives it a unique ID and the current time, and saves it to a small file on the phone.- The SDK sends saved events in batches: 1 second after your last
track, when the app goes to the background, and on the next launch. - If the network is down or the server is busy, it keeps the events and tries again, waiting longer each time (up to 5 minutes). Because each event keeps its ID, a retry is never counted twice.
So an event survives the app being killed, the phone going offline, or a crash. The only events that are lost are ones tracked while the phone never came back online before the app was uninstalled.
Consent#
If someone declines tracking, turn events off. It clears anything waiting, stops track, identify and logout, and is
remembered across launches. Install attribution and deep links keep working, because they're needed to open the right screen.
Dropplink.setTrackingEnabled(false)
val enabled = Dropplink.isTrackingEnabled()Dropplink.setTrackingEnabled(false)
let enabled = Dropplink.isTrackingEnabledawait Dropplink.setTrackingEnabled(false);
final enabled = await Dropplink.isTrackingEnabled();Dropplink.setTrackingEnabled(false);
const enabled = await Dropplink.isTrackingEnabled();Turning it back on resumes tracking from that point. Nothing tracked while it was off is recovered.
Who gets the credit#
An event is credited when it's stored, and that never changes later:
- After
identify: to the creator who gets that user's revenue, on every device they use. - Before it: to the link that brought this install, or organic if none did.
Call identify as soon as someone logs in, so their events follow the user rather than the phone.
See your events#
Paste an install ID into Install debugger in the dashboard. Under Latest events you'll see this install's last 50 events, newest first, each with its time, whether it came from the App or your Server, its revenue (with the rupee value for other currencies), and who it was credited to. Open a row to see its properties, order ID and event ID. See What you see for each user.
Next: Identify your users, then send revenue from your server.