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.
PLUMBR.startTransaction(serviceName)
Starts a new transaction under serviceName
service. As there can only be one ongoing transaction at a time, there is no API call for ending transaction. Starting a new transaction will always end the ongoing transaction
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) {} messageServerAboutExternalForce(); });
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({ /* ... */ }); });