Since: 1.38.0
Start Page
Call FSPage#start
to signal the start of a view for the page (see
Create Pages). Nested page views are not supported. That will
be considered the current page until FSPage#end
or another FSPage#start
is
called.
This is analogous to onResume
in an Activity and Fragment and should
typically be called there, but this may be called at any time when your page
boundary is not tied to an Activity or Fragment transition (e.g., a single
authentication Activity toggles between login and sign up).
Subsequent calls to start
will be considered distinct views of the page.
When calling the variant that accepts page property updates as a parameter, the page properties will be updated before the view of the page starts. This will merge the properties similar to calling updateProperties, not replace all current properties, but the update and start will occur as a single event.
Parameters
A map containing properties of the page that will be indexed by Fullstory. These properties will be merged with any current properties before the page is started.
Caveats
If the user changes (i.e., by calling FS.anonymize
when a user is
set or by calling FS.identify
when a different non-anonymous user
is set), a new session will start, and the current page will not be defined.
You must call FSPage#start
again if you would like the previous page view data to be set in the new
user's session.
FSPage#start
and other page-related methods may be called while Fullstory capture is
shut down.
However, only the current page data at the time restart
is called will be captured. For example, consider the case in which events happen in the following order (represented in pseudocode):
pageA = FS.page("PageA", { "var1": 1 })
pageA.start()
FS.shutdown()
pageA.updateProperties({ "var1": 2 })
FS.page("PageB").start()
pageC = FS.page("PageC", { "var1": 1 })
pageC.start()
pageC.updateProperties({ "var2": "C" })
FS.restart()
In playback you would see: PageA
has a property var1
with a value of 1
; capture stops; and then capture resumes
with PageC
which has a property var1
with a value of 1
and var2
with a value of "C"
. The update of var1
to 2
on PageA
and the page view for PageB
are lost, because these were never properties of the current page while
capture was enabled.
Limits
Additional Information
- Java
- Kotlin
public void start();
public void start(Map<String, ?> propertyUpdates);
Example Invocations
Start a page view for a page in the app
private FSPage page; // Initialized in onCreate
@Override
public void onResume() {
super.onResume();
page.start();
}
Start a page view for a Cart page updated with the current item count
private FSPage page; // Initialized in onCreate
@Override
public void onResume() {
super.onResume();
page.start(new HashMap<String, Object>() {
{
put("cartSize", cart.size);
}
});
}
Capture a page view when property updates and manual ending are not needed
@Override void onResume() {
super.onResume();
FS.page("myPage").start();
}
fun start()
fun start(propertyUpdates: Map<String, *>)
Example Invocations
Start a page view for a page in the app
private var page: FSPage? = null // Initialized in onCreate
override fun onResume() {
super.onResume()
page?.start()
}
Start a page view for a Cart page updated with the current item count
private var page: FSPage? = null // Initialized in onCreate
override fun onResume() {
super.onResume()
page?.start(mapOf("cartSize" to cart.size))
}
Capture a page view when property updates and manual ending are not needed
override fun onResume() {
super.onResume()
FS.page("myPage").start()
}