The above percentage are of visitors which will be considered for retention; a session which is not within the retention rate will be deleted within processing. This allows clients to collect all user interaction during a session and determine at a later stage if the session is worth retaining through the ‘setRetention’ Decibel API call.
The endpoint that is required for forcing retention can be seen below:
Or you can add this to all pages
Please note: When used, this will force a user to be retained (i.e. the session will be kept and not discarded). This will include the session from beginning to end, provided they are within the collection sample. If the client has a collection sample rate other than 100%, the session may not be retained. Also, if calling setCollection and then setRetention, the session will only have been collected from the point of the setCollection call, so only these pages of the session will be retained.
So, in the example wherein page 3, the setRetention call is being made;
Page 1 > Page 2 > Page 3 (setRetention) > Page 4
The full session will be retained and data collected in all pages from 1-4, will be in the replay.
If pages are cross domains, although the retention call would work, it may also complicate the matter with CORS policy, so this would need to be checked too. However, if they are on the same domain, then it should work.
Meanwhile, the following example shows a session being marked for retention following a checkout button, being clicked on the website:
// Enable collection for the current session and future sessions for the current visitor.// Enable collection for the current session and keep the visitor in the sample for up to three days. // Disable collection for the current session only.