WFH Tip: 28 How to update visitor information on the Zia Skills platform?

WFH Tip: 28 How to update visitor information on the Zia Skills platform?

The Visitor Object in the Zobot:

The visitor object is a map that contains the profile information of the website visitor. This will be available inside the messageData map across all scripts inside Zia Skills.It contains properties like name, email, city, country, campaign details, landing page URL, etc.
  1. "visitor":
  2. {
  3.   "name": "Tricia",
  4.   "email": "tricia@zylker.com",
  5.   "phone": "005678900677",
  6.   "browser": "Apple Safari",
  7.   "country_code": "us",
  8.   "os": "Apple Macintosh",
  9.   "city": "Los angels",
  10.   "state": "California",
  11.   "question": "Hello, I would like to know my shipping status",
  12.   "campaign_content": "end_sale",
  13.   "campaign_medium": "UTM"
  14.   "campaign_source": "email",
  15.   "current_page_url": "https://www.zylker.com/furnitures/",
  16.   "previous_page_url": "https://www.zylker.com/home/",
  17.   "last_call_attender": "(Operator id)",
  18.   "landing_page_url": "https://www.zylker.com",
  19.   "landing_page_title": "Zylker-Furnitures-Home",
  20.   "number_of_past_visits": "6",
  21.   "number_of_past_chats": "2",
  22.   "lead_score": "200",
  23.   "referer": "https://www.zylker.com",
  24.   "crm_type": "Lead | Contact",
  25.   "company_name": "Zylker inc.",
  26.   "company_employees": "7000",
  27.   "ip": "127.89.077.12",
  28.   "visitid": "234",
  29. "department_id": "606000001830053",
  30.   "uuid": "47324902-6799-4c4f-a53b-29839e39ccc3_3"
  31.   "last_visit_time": "1566472239770"
  32.   "custom_info" : 
  33.     {
  34.     "customer_id" : "1532",
  35.     "tier" : "gold"
  36.       },
  37.   "operation": "chat"
  38. }

Updating visitor info in Zia Skills:

The information of the website visitor like the name, email id, phone number, etc., will always be automatically available under the 'messageData' map in the 'visitor' object.  This map will be available across all the functions in Zia Skills. The 'visitor' key is a map object from which the visitor's info can be retrieved using 'get()' function.

If you want to configure your bot to update the visitor's info like name, email, phone, id, city, etc., dynamically at runtime, the property name and its appropriate value can be passed as a Map value to the 'trigger' key of the Execution logic output in Zia Skills platform as shown in the format below.
  1. “trigger” : {
  2.     “type” : “update”
  3.     “data” : {
  4.     “property_name” : “<value to be updated>” 
  5.       }
  6. }

To learn more about this, start building your own Zobot right away.
For more information, check out our Help Documentation.

Regards,
Michelle