Menu

Visitor ID

     Visitor ID refers to the user's unique identifier (_visitor_id) after install and before login.

     We provide an interface for developers to customize visitor IDs. If you have your own visitor management system and need to replace SolarEngine's visitor IDs, you should set it before initializing the SDK.

     During data reporting, only the latest visitor ID passed in will be used. Multiple calls should be avoided to prevent abnormal situations where multiple visitor IDs are reported consecutively.

Set Visitor ID

Function

export function setVisitorID(visitorID:string);
ParameterMeaningTypeRequired
visitorIDVisitor ID to be setStringYes

Sample Code

//It is recommended to call before SolarEngine SDK initialization
let visitorID:string = "your visitor id";
SolarEngine.setVisitorID(visitorID);

Note:

  1. This call only reports visitor IDs to the SDK and does not report _appLogin events.
  2. The visitor ID cannot exceed 128 characters, otherwise the setting would fail.

Get Visitor ID

      Call fetchVisitor to get the current visitor ID:

export function fetchVisitor():string;

       The previously set visitor ID will be returned.

Sample Code

let visitorID = SolarEngine.fetchVisitor();


Previous
Obtain distinct_id
Next
Account ID
Last modified: 2024-12-05Powered by