Client object¶
With Alan’s client
object, you can get general information about users interacting with the in-app assistant:
Approximate user’s location
Interactions statistics for the user
In the example below, Alan writes to Alan logs information about every user interacting with the in-app assistant and user events.
onUserEvent((p, e)=> {
console.log(e, p.client);
});
Client object data¶
The client
object provides the following user data:
{
geoLoc: {
city: 'Sunnyvale',
continent: 'North America',
country: 'United States',
lat: 37.3479,
lon: -122.0351,
source: 'ip-address'
},
ip: '67.195.198.201',
stats: {
interactions: 0,
lastConnectTs: 1617975166387,
lastInteractionTs: 0,
recognized: 0,
unrecognized: 0
},
timeZone: 'America/Los_Angeles'
}
Field name |
Data type |
Description |
---|---|---|
|
String |
User’s city |
|
String |
User’s continent |
|
Float |
Latitude of the user’s position |
|
Float |
Longitude of the user’s position |
|
String |
Data source |
|
String |
User’s IP address |
|
Integer |
Number of interactions with the user |
|
Integer |
Timestamp of the last connection to the in-app assistant |
|
Integer |
Timestamp of the last interaction with the in-app assistant |
|
Integer |
Number of recognized user’s interactions |
|
Integer |
Number of unrecognized user’s interactions |
|
String |
User’s time zone |