> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trueorigin.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Tracking events

> Count sign-ups, purchases and your own events per campaign.

Track what happens in your app after the install. Each event belongs to the install, so
the dashboard shows it under the campaign that brought the install: in the activity
feed, and for purchases in the overview's revenue.

Swift only for now, from iOS SDK 0.2.0; React Native and Android follow.

```swift theme={null}
TrueOrigin.track(.signUp)

// after a verified StoreKit purchase
TrueOrigin.track(.purchase, amount: product.price, currency: product.priceFormatStyle.currencyCode,
                 properties: ["product_id": product.id])

// your own event
TrueOrigin.track(.custom("level_up"), properties: ["level": "5"])
```

`track` returns at once and never throws. It works before `configure` too.

## Events

| Event | In the dashboard |
| - | - |
| `.signUp` | Sign up |
| `.login` | Login |
| `.purchase` | In-app purchase. Its amount is revenue. |
| `.startTrial` | Trial started. Counts as a trial in the overview. |
| `.subscribe` | Subscription started. Its amount is revenue. |
| `.addToCart` | Add to cart. Its amount is kept, but it is not revenue. |
| `.custom("…")` | Your own name: 1 to 40 letters, digits and underscores, starting with a letter. |

A name that is not on the list does not compile; use `.custom` for anything else.

## Amount and properties

`amount` is what the event was worth, as a `Decimal`, with an ISO 4217 currency code such
as `"EUR"`. Amount and currency always go together. For `.purchase` and `.subscribe` the
amount is revenue: the dashboard converts it to US dollars at the latest ECB reference
rate when the event arrives. An amount in a currency the ECB has no rate for stays in the event at its own
amount, but not in the revenue.

`properties` are up to 10 strings of your own. Keys follow the rule for custom names,
values have at most 100 characters.

An event that breaks a rule is dropped, and the SDK logs why, also with `logging` off.

## When events arrive

Events wait on the device, in the app's own storage, until the install has been reported
and the device is online. They then go to TrueOrigin in the order you tracked them. If
the connection drops, the SDK sends them again later; each one is counted once. Events
wait across launches, up to 1,000 of them. If the install could not be reported at all
(status `failed`), its events are dropped.

Events of TestFlight and Xcode builds are filed as sandbox, like their installs, and do
not count in the overview.

<Warning>
  With [RevenueCat](/revenuecat) connected, RevenueCat already reports trials,
  subscriptions and purchases. Don't track `.startTrial`, `.subscribe` or `.purchase`
  with the SDK as well: both would count.
</Warning>

Tracked events are not sent to Meta or TikTok as [postbacks](/postbacks) yet.
