Transaction Management

In most cases the browser agent is able to automatically detect all of the the user interactions. However there might be cases where you’d want to start transactions manually.


Starts a new transaction under serviceName service.

Example usage: Starting a transaction when document receives an external-force event

document.addEventListener('external-force', function (event) {
    try {
        PLUMBR.startTransaction('External force');
    } catch(err) {}

Note: Include the api call as close to the source as possible. That way when the browser agent starts detecting it natively, it will try to avoid creating multiple transactions.

document.getElementById('sign-up').addEventListener('click', function (event) {
    try {
        PLUMBR.startTransaction('User signs up');
        // Because browser agent has already detected the click it will be translated to
        // PLUMBR.setServiceName('User signs up')
    } catch(err) {}

    registerUser({ /* ... */ });