Concepts
Purchases and sessions
How the SDK records purchases and refunds, how sessions are timed, and where both show up.
Purchases
A purchase is an amount, a currency, a time and an order id. The iOS SDK records it with Xulo.purchase. See Purchases for the call.
- The amount is in minor units of the currency.
1500withUSDis $15.00. - The currency is a three-letter code. It is stored in upper case.
- Sending the same order id again on the same app replaces that order's amount.
- A refund is the same order id with the amount that remains.
- Amounts stay in their own currency. Xulo does not convert them.
If the install is logged in with an External ID, the purchase belongs to that person, so purchases from all of their phones add up. Without an External ID it stays on the install.
The person page in the dashboard shows the lifetime total in each currency, and the orders.
A purchase is not a separate charge on your bill.
Sessions
The SDK times sessions without any extra code.
- A session starts when the app comes to the foreground.
- Coming back within 30 seconds of leaving continues the same session.
- A session's length is capped at 12 hours.
- If the app is killed before it can report, the next launch closes that session. It still counts as a session, but its time is not added.
- The server does not count the same session twice.
Sessions of all installs with the same External ID add up for that person. The person page shows the session count and the total time.
Sessions do not change opens, monthly active users or Return.
In segments
Saved segments can filter on both, in the last 24 hours, the last 7 days, the last 30 days or all time:
- people who spent, did not spend, or spent at least an amount in one currency
- people with at least a number of sessions, at least a number of minutes, or both
A spend window looks at when the payment was made and at the current amount. Refunding an old order changes the lifetime total and the all-time window. It does not look like a new purchase in the last 24 hours.