To keep track of important user flows and interactions such as signup, login, upgrade, checkout and app purchases, transactions are required. Code must be added to specify where a transaction begins and ends.

Following are some of the custom transaction functions used in Atatus.

Beginning a transaction

To start a transaction, make use of the beginTransaction() function. When using this function, Atatus will start to time the duration of the transaction.

Syntax

atatus.beginTransaction(transaction_name)

Parameter

Parameter Type Description
transaction_name String (Required) Transaction name.

Example

atatus.beginTransaction("Login");

Ending a transaction

To know if a transaction currently running has successfully completed, use the endTransaction() function. The transaction time will be recorded and reported to Atatus.

Syntax

atatus.endTransaction(transaction_name)

Example

atatus.endTransaction("Checkout");

Failing a transaction

The failTransaction() function will notify Atatus on the failure of any transaction. The time at which the transaction fails will be recorded and reported to Atatus.

Syntax

atatus.failTransaction(transaction_name)

Example

atatus.failTransaction("Signup");
Note:

You can either call endTransaction() or failTransaction() to record a transaction. Both the functions cannot be used together.

Recording a transaction with duration

To record a transaction with a time duration (ms), the recordTransaction() function is used. This function is useful when you do not begin or end a transaction.

Syntax

atatus.recordTransaction(transaction_name, time)

Parameter

Parameter Type Description
transaction_name String (Required) Transaction name.
time Number (Required) Time duration in milliseconds(ms).

Example

atatus.recordTransaction("Login", 5)