• Release Notes
  • User
  • Admin
  • Developers
  • Integrations

›Use Cases

General

  • Co-Browsing
  • Universal Embedded Co-Browsing
  • Chat
  • Videocalling with Queue
  • Generate API Token

External

  • Salesforce
  • Outlook
  • Freshdesk
  • Microsoft Teams
  • ZealiD
  • Individual Platform

Data

  • Audit Logs

Use Cases

  • CoBrowsing - Example
  • SessionRecording - Optin/Optout button
  • UserTagging & Login Example
  • UserTagging & Screensharing Example
  • Mobile user tagging & LiveView
  • WebChat API - Example
  • ActionRules Matched API - Example

REST API Examples

  • Agent Times
  • Rule matches
  • Appointments
  • Universal Co-Browsing

UserTagging & Login Example

This usecase describes example steps for using the API to retreive chat history for existing logged-in users. Additionally, visitor sessions should only last for the duration of their browser session. A logout function will reset the chat to an empty state and treat the visitor as a new customer.

1. Setup Session-Based ID

Chatvisor gives any user who visits a page which has our JavaScript implemented their own ID. Usually, these IDs are stored and read from localstorage and can last long. In this case we want any user who is not logged in to always be presented with a completely fresh Chat session, even if they have had a conversation before.

To achieve this, Chatvisor has to be switched to "Session-Based IDs", which are stored in sessionstorage and deleted once the user closes the browser window.

More information on this setting can be found here.

alt-text

2. Add tagging code to application

On a page where the user is signed-in, add a call to the tagging method with user data available from your application. This adds user information to an existing browser session.

CV.user.tag({
    "email": "john.doe@chatvisor.com",
    "firstname": "John",
    "lastname": "Doe",
    "labels": []
})

In your logout function, include a call like this in order to reset the user session. This removes the current chat history from their chat window and treats the user as a new customer from then on.

CV.user.reset();

If you want to assign a customer to a specific agent, you can include the assignedUser property like this:

CV.user.tag({
    "email": "john.doe@chatvisor.com",
    "firstname": "John",
    "lastname": "Doe",
    "assignedUser": "agent1@chatvisor.com"
    "labels": []
})

3. Check results

With this setup done, any user who visits the page will always receive a fresh Session ID, and thus will see an empty chat.

A user who logs in will automatically have their chat history retreived and visible in the chat window.

A user who logs out will not see their chat history anymore and instead be treated as a new customer.

← SessionRecording - Optin/Optout buttonUserTagging & Screensharing Example →
  • 1. Setup Session-Based ID
  • 2. Add tagging code to application
  • 3. Check results
MANUALS
User Manual: Sales Suite
Admin Manual: Sales Suite
User Manual: Support Suite
Admin Manual: Support Suite
DEVELOPERS
Integrations
REST API
SDK API
LEGAL
Privacy Policy
Terms and Conditions
Imprint
Engage
Copyright © 2024 TeamViewer Austria GmbH