Transactions allow you to track key interactions or user flows in their app such as login, signup, checkout, upgrade, and in app purchase. You must add code to specify where a transaction starts and where a transaction ends.
Beginning a Transaction
The beginTransaction method denotes the start of a transaction. At this point, Atatus begins timing the duration of the transaction.
Instead of key_transaction_name, you can specify your key transaction name. e.g: Signup, Checkout
Ending a Transaction
The endTransaction method tells Atatus that the given transaction has successfully completed. At this point, the transaction time is recorded, and the transaction will be reported to Atatus.
Failing a Transaction
The failTransaction method tells Atatus that the given transaction has failed. At this point, the transaction time is recorded, and the transaction will be reported to Atatus.
You can call either endTransaction or failTransaction to record the transaction, but not the both.
Canceling a Transaction
The cancelTransaction method tells Atatus that the given transaction has canceled and will not be reported to Atatus. Canceled transactions are ignored.
You have to call cancelTransaction instead of endTransaction or failTransaction to cancel the transaction.
Record a transaction with duration (ms)
The recordTransaction method is used to record a transaction with supplied duration. It is useful when you don't begin and end the transaction.
Here 120 is the duration in milliseconds.