getVisitorInfo

The getVisitorInfo() method returns information about the visitor.

Syntax

getVisitorInfo()
getVisitorInfo(): Promise<VisitorInfo>
getVisitorInfo(): Promise<VisitorInfo>
getVisitorInfo(): Promise<VisitorInfo>
getVisitorInfo(): Promise<VisitorInfo>
getVisitorInfo(): Promise<VisitorInfo>
getVisitorInfo(): Promise<VisitorInfo>

Returns

Information about the visitor.

Format: The following visitor information:

  1. New visitor:1 Returning visitor: 0
  2. Visitor ID: 16-character hex number
  3. First visit timestamp: UNIX epoch time
  4. Previous visit count: "0" for the first visit
  5. Current visit timestamp: UNIX epoch time
  6. Last visit timestamp: UNIX epoch time or "" if N/A
  7. Last ecommerce order timestamp: UNIX epoch time or "" if N/A

Type: string[]

Examples

To return visitor information:

_paq.push([function () {  
    console.log(this.getVisitorInfo());  
}]);
getVisitorInfo(): Promise<VisitorInfo>
getVisitorInfo(): Promise<VisitorInfo>
getVisitorInfo(): Promise<VisitorInfo>
getVisitorInfo(): Promise<VisitorInfo>
getVisitorInfo(): Promise<VisitorInfo>
getVisitorInfo(): Promise<VisitorInfo>

A sample of the return value:

[  
    "0",  
    "6d85cb0b727eca52",  
    "1624261490",  
    "12",  
    "1631115486",  
    "1631115483",  
    "1630590788"  
]

Related methods