LogoLogo
WebsiteGuide & TutorialBlogBook a Demo
1.0.0
1.0.0
  • Acquire Developers Hub
  • Acquire
    • Acquire Build Requirement
      • Requirement For Acquire
      • Acquire Speedtest
  • JS API
    • JS Live Chat API
      • Description
      • Installation
      • Visitor
      • Thread
      • Conversation
      • User Verification
    • Quick Link Support
      • One Click Button
      • Social Media Share
    • Backend JS SDK
      • Setup Backend JS SDK
      • Demo Backend SDK
    • Advanced
      • Widget UI
      • Reference
  • Co Browse APIs
    • Acquire Co Browse
      • Co Browse API
  • Acquire API Events
    • WebRTC Related Events
  • iOS
    • SDK Setup Guide
      • Getting Started
      • Integration Guide (Core)
      • Integration Guide (Lite)
      • Manual Setup iOS
      • Acquire Account ID
    • SDK Configuration Example
    • iOS Cobrowse
    • Theme Setting
    • iOS Push Notifications
    • Verify your users
  • Android
    • Getting Started
      • Integration Guide (Core)
      • Integration Guide (Lite)
      • Start using Acquire
    • Acquire APIs
    • Acquire Delegates
    • Custom UI/widget
    • Cross Platform Integrations
  • Webhook API
    • Webhooks Basic
      • Introduction
      • Webhook Integrate Steps
      • Webhook Format
    • Webhook Events
      • On Chat Start
      • On Chat Accept
      • On Chat Message
      • On Chat Close
  • REST APIs
    • OAuth
      • Authorization
      • Tracklog
    • Profiles API
      • Profile List
      • Thread
      • Feedback
      • Profile Details
      • Message
      • Tags
      • Profile Agents
      • Campaigns
      • Profile Add Update
      • Profile Delete
      • Profile Visit History
      • Sender Emails
    • Chat
      • Chat Notes
    • Analytics
      • Chat Statistics
      • Team Analytics
      • Conversion Rate
      • Chat Tag
      • Co browsing
    • Agent
      • Agents List
      • Agent add
      • Edit / Get-agent
      • Update
    • Trigger
      • Triggers List
      • Triggers Detail
    • Operating Hours
      • Save Operating Hours
      • Get Operating Hours
    • Cobrowse
  • Chatbot API
    • Chat Bot
      • Integrate Your Chatbot
      • Dialog Flow V1 Chat-Bot
      • Dialog Flow V2 Chat-Bot
      • Dialog Flow Fulfillment & Custom Response
      • IBM Watson Integration
      • Amazon Lex Bot
      • Azure's QnA Maker
      • Webhook Calling & User Verification
      • Webhook For Reset Password
  • Knowledge Base APIs
    • Help Docs Setup
      • Get FAQ Categories
      • Get Setup Details
      • Get Side List
      • Get Article
      • Get Recent Article
      • Get Categorized Articles
      • Get Suggestion
  • Errors
    • API Error Handling
      • HTTP Responses
Powered by GitBook
On this page
  • Get Visitor
  • Visitor Name
  • Visitor Email
  • Visitor Phone
  • Set Visitor
  • Set Customer Tracking
  • Visitor Page Update
  1. JS API
  2. JS Live Chat API

Visitor

Get Visitor

Visitor Name

Get the name of the visitor.

Sample Code

<script>
   window.acquire = window.acquire || [];
   window.acquire.push(function(app){
      app.userDetails.subscribe(function(){
           alert(app.userDetails().name);
      });
   });
</script>

Visitor Email

Get the email address of the visitor.

Sample Code

<script>
   window.acquire = window.acquire || [];
   window.acquire.push(function(app){
      app.userDetails.subscribe(function(){
           alert(app.userDetails().email);
      });
   });
</script>

Visitor Phone

Get the phone number of the visitor.

Sample Code

<script>
   window.acquire = window.acquire || [];
   window.acquire.push(function(app){
      app.userDetails.subscribe(function(){
           alert(app.userDetails().phone);
      });
   });
</script>

Set Visitor

Set Customer Tracking

Set the visitor’s name, email address, phone number and remark. Use the script at right to update visitor details.

Step 1: Embed tracking code

Copy the sample customer tracking code under <HEAD> section of your webpage before widget code.

Step 2: Reload Webpage

Save your code and reload webpage.

Make sure you replace inside bracket words with your own code that outputs real user data for the currently logged-in user on each of your pages.

All are optional, you can pass only those value that you wanted and you can remove which details you don't have.

A convenience function to set multiple settings at once. Accepts a settings object.

Parameters userDetails key detail:

Attribute

Type

Description

name

string

Visitor’s name

email

string

Visitor’s email address

phone

string

Visitor’s phone number

remark

string

Visitor’s remark

<script>
   window.acquire=window.acquire||[];
   acquire.push({
                  userDetails:{
                      name:'Visitor',
                      phone:'0000000000',
                      email:'visitor@site.com',
                      remarks:'anything remark to customer track'
                  },
                });
</script>

Visitor Page Update

Programmatically update visitor’s web-path.

Note: Chat triggers set to run “When a visitor has loaded the chat widget” will be fired when the visitor path is changed.

Attribute

Type

Description

title

string

title of page

url

string

Url for page

Optional - If not specified, the current page’s location and title will be used; if specified, the updated page url and title will be taken from the options object.

Update visitor’s path with specific page url and title:

<script>
    // update visitor's path with specific page url and title
    window.acquire=window.acquire||[];
    acquire.push(function(app){
      app.visitorPageUpdate('example title', 'http://example.com');
    });
</script>

Update visitor’s path with current page’s location and title:

<script>
    // update visitor's path with current page's location and title
    acquireIO.visitorPageUpdate(title, url);
</script>
PreviousInstallationNextThread

Last updated 6 years ago