DropplinkDocsPowered bydropp.

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:

FromUse it forHow it's counted
Your app, with trackThe funnel: screens, sign-ups, add to cart, checkout startedEvery event. Revenue in it is shown as app-reported.
Your server, with POST /v1/s2s/eventsPurchases, renewals, refundsThe revenue that counts for creators.

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#

Android
Dropplink.track("add_to_cart", mapOf("sku" to "TSHIRT-M", "qty" to 1, "gift" to false))
iOS
Dropplink.track("add_to_cart", props: ["sku": "TSHIRT-M", "qty": 1, "gift": false])
Flutter
Dropplink.track('add_to_cart', props: {'sku': 'TSHIRT-M', 'qty': 1, 'gift': false});
React Native
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.

Android
Dropplink.track("purchase", revenue = Revenue(amount = 499.0, currency = "INR", orderId = "A1023"))
iOS
Dropplink.track("purchase", revenue: Revenue(amount: 499, currency: "INR", orderId: "A1023"))
Flutter
Dropplink.track('purchase', revenue: Revenue(amount: 499, currency: 'INR', orderId: 'A1023'));
React Native
Dropplink.track('purchase', { revenue: { amount: 499, currency: 'INR', orderId: 'A1023' } });
FieldRules
amount0 or more. More than 2 decimals are rounded (1.005 → 1.01). Refunds can't come from the app: send them from your server.
currency3 letters, like INR or USD. Lower case is fixed for you.
orderIdOptional, up to 128 characters. Send the same one from your server too, so the two can be matched.

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#

RuleIf it's broken
Event namesnake_case: a lower-case letter, then letters, digits or _, up to 64. add_to_cart, not Add To Cart.The event is dropped.
Property keysUp to 20, each 1–40 letters, digits or _.Extra or invalid keys are dropped; the event is kept.
Property valuesText (up to 256 characters), numbers, true / false or null.Longer text is cut to 256. Lists, maps and dates are dropped.
Personal dataNo emails or phone numbers in properties.That property is dropped, by the SDK and again by the server.

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_cart

What 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.

EventWhenUseful properties
sign_upAn account is createdmethod (phone, google, …)
loginA returning user signs inmethod
view_itemA product or content page opensitem_id, category
add_to_cartSomething goes into the cartitem_id, qty, price
checkout_startedCheckout opensitems, value
purchasePayment succeeds (send it from your server too)revenue, items
subscribeA subscription startsplan, revenue

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:

  1. track checks the event, gives it a unique ID and the current time, and saves it to a small file on the phone.
  2. 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.
  3. 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.

LimitWhat happens
1,000 events or 1 MB waiting on the phoneThe oldest events without revenue are dropped first. Events with revenue are kept.
Events older than 7 daysDropped, since the server only accepts the last 7 days.
600 events a minute from one installThe server asks the SDK to slow down, and nothing is lost.

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.

Android
Dropplink.setTrackingEnabled(false)
val enabled = Dropplink.isTrackingEnabled()
iOS
Dropplink.setTrackingEnabled(false)
let enabled = Dropplink.isTrackingEnabled
Flutter
await Dropplink.setTrackingEnabled(false);
final enabled = await Dropplink.isTrackingEnabled();
React Native
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.

Something unclear? Tell us.Powered bydropp.