A state is any part of your app a user can be in. For example, some states can include being in a particular level, watching a video, or browsing an in-app store. All states have a time and a duration. The duration is set automatically -- when one state begins, the previous one ends.

Advancing to a state.

This example is called when the user advances to their cart. You can also pass a parameter.

// Tracks a state with a numeric parameter.
Leanplum.advanceTo("Cart", {numItems: 2});

Pausing and resuming.

You can use this if your app has modals, or a "pause" mode. You shouldn't call it when someone switches out of your app because that's done automatically.


The 'null' state.

Causes the user to leave the current state and not enter another one.