Using the API, you can stop the session at any moment.
Let’s imagine that your application is used in a restaurant and the users can place their orders there. It’s possible to base your choice on the screens they visit or events they complete. In this case, the Purchase completed screen can be considered the last one, and the Home or Menu screen can start another session. Alternatively, the Payment completed event can end the session and the Clicked on the menu event can start another one.