In case the user and session management is done by your backend, Copilot SDK and Copilot cloud should be aware regarding user's active session information. This component functionality is reachable by accessing
Notify to Copilot start tracking user's session when an authenticated session is obtained by your user management solution (e.g. user just performed signup or login in your application). The
sessionStarted() method accepts the following parameters:
userId- (String) - The unique user identification used in your user management solution. This value should be exact same value that will be passed to the Collect API once triggered from your backend for this specific user.
isCopilotAnalysisConsentApproved- (Boolean) Property indicating whether the user accepted analytics tracking. In case the application does not require GDPR compliance, set this parameter as constant
The session data you provide is persistent on the mobile device. Meaning, after setting user's session data once, and the user re-starts the application, the values above will be used to track user's session until
sessionStarted()method will be invoked.
Notify to Copilot end tracking of user's session when user performs logout in your application. Session data will be removed and any consecutive analytics event won't be bound to specific user's session.
Update user's consent
Notify to Copilot to modify user's analytics tracking consent as which was set in when calling previously to the
sessionStarted() method. The
setCopilotAnalysisConsent() method accepts the following parameter:
isCopilotAnalysisConsentApproved - (Boolean) Property indicating whether the user accepted analytics tracking. In case the application does not require GDPR compliance, set this parameter as constant true.