Collecting visitor data with Custom Visitor Info and Variables

Gather information about visitors and pass it to BoldChat to help operators achieve business goals.

You can pass custom info and custom variables from the HTML code for a Chat Button, Visitor Monitoring, or Conversion Tracking. This article covers the variables that are available per HTML code type.

Chat Button Variables

Select the Pass Custom Visitor Information option when generating Chat Button HTML.

vr: visitor reference
Passes any desired information about a specific visitor. An initial value is not passed to this variable via the operator client.
vn: visitor name
Passes the visitor's name. This variable passes the value of the Name field from the pre-chat form.
vi: visitor information
Passes any desired information about a specific visitor. An initial value is not passed to this variable via the operator client.
ve: visitor email
When using a pre-chat form as part of your Chat Window definition, this variable passes the value of the Email field from the pre-chat form.
vp: visitor phone
When using a pre-chat form as part of your Chat Window definition, this variable passes the value of the Phone field from the pre-chat form.
lc: language code
When using a pre-chat form as part of your Chat Window definition, this variable passes the value of the Language field from the pre-chat form.
iq: initial question
When using a pre-chat form as part of your Chat Window definition or Auto-Invite, this variable passes the initial question from the pre-chat form or pre-chat auto-invite form.
Note: The iq variable must be inserted manually into the WindowParameters section of the Chat Button HTML code in the section highlighted below.

Values are passed when the visitor initiates a chat. Values are shown on the operator grid together with the incoming chat.

Variables within the Chat Button HTML code
Figure 1. Variables within the Chat Button HTML code

Visitor Monitoring Variables

Select the Pass Custom Visitor Information option when generating Visitor Monitoring HTML.

vr: visitor reference
Passes any desired information about a specific visitor. An initial value is not passed to this variable via the operator client.
vn: visitor name
Passes the visitor's name. This variable passes the value of the Name field from the pre-chat form.
vi: visitor information
Passes any desired information about a specific visitor. An initial value is not passed to this variable via the operator client.
ve: visitor email
When using a pre-chat form as part of your Chat Window definition, this variable passes the value of the Email field from the pre-chat form.
vp: visitor phone
When using a pre-chat form as part of your Chat Window definition, this variable passes the value of the Phone field from the pre-chat form.
url: URL
Pass the visitor?s current URL (the URL of the visitor's current page).
curl: custom URL
Pass a URL that differs from the page of origin (that is, do not pass the URL of the visitor's current page). This can be useful for identifying a URL or page that would normally be blocked due to business rules that prevents the page from being displayed because of dynamic or sensitive information.
Tip: When using Visitor Monitoring HTML on a site that requires registration, values can be passed once a visitor signs in to their account. Use the Data Validation feature when passing sensitive data. See How to validate Chats, Visits and Conversions (Data Validation).

All variables are passed from one page to the next and remain set until a new value is passed. This allows for the Visitor Monitoring to maintain the associated value throughout the visit, as well as passing those values to the Conversion Code (see below).


Figure 2. Variables within the Visitor Monitoring HTML code
Variables within the Visitor Monitoring HTML code

Conversion Tracking Variables

Select the Pass Custom Conversion Information and Pass Custom Visitor Information options when generating Conversion Code HTML.

Important: When implementing Conversion Tracking, you must ensure that your Visitor Monitoring HTML, Conversion Tracking HTML, and Chat Button HTML are all associated with the same Website definition.
ca: conversion amount
Passes the conversion amount. Requires a number (with a decimal point for decimal values).
cr: conversion reference
Passes the conversion reference (such as an invoice or order number). This is a uniquely valued parameter. Duplicate conversion references are not allowed and will not trigger new conversions unless you change either the conversion reference or use a different conversion code (or leave it blank).
ci: conversion information
Passes any desired information about a specific visitor. An initial value is not passed to this variable via the operator client.
vr: visitor reference
Passes any desired information about a specific visitor. An initial value is not passed to this variable via the operator client.
vn: visitor name
Passes the visitor's name. This variable passes the value of the Name field from the pre-chat form.
vi: visitor information
Passes any desired information about a specific visitor. An initial value is not passed to this variable via the operator client.
ve: visitor email
When using a pre-chat form as part of your Chat Window definition, this variable passes the value of the Email field from the pre-chat form.
vp: visitor phone
When using a pre-chat form as part of your Chat Window definition, this variable passes the value of the Phone field from the pre-chat form.

How to Set up Custom Variables

This section helps you implement custom variables and put them to use to solve business needs.

Variable values remain the same from page to page unless changed. With this in mind, we do not recommend using both Chat Button custom variables and Visitor Monitoring custom variables on the same page. A good example of why this is not necessary would be when a customer comes to your site and signs into their account. The Visitor Monitoring code sets the custom variables appropriate to the information from the customer's account. The customer then decides to launch a chat, these variable are then passed into the Pre-Chat form and pre-populate the form for the customer. By having the variables also available in the Chat button code, it opens the possibility of having the values from the Visitor Monitoring code overwritten by the Chat Button variable assignment.

Passing Conversion Tracking Variables

Once the code containing your custom variable has been generated, you must edit the script to set the variable assignment. This is easily accomplished with a little JavaScript or with your preferred scripting language via the getPageViewer directive.

Note: Conversion Tracking Variable values are automatically updated each time the VMS code is run.

In the above highlighted example, customerId is a variable that you would create and associate the desired value from the page. Please notice that both vi variables have been set, this is necessary to ensure the variable assignment functions for both JavaScript enable and Non JavaScript enable browsers.

Now, let's take look at how you would set the value for customerId using a little JavaScript. Once the value is set it will then be passed to the vi variable, this occurs because we have set vi=customerId or more specifically, the value of customerId will be assigned to vi.

Assuming the value of the customer number is exposed in some way, such as an element identifier on the web page. For example, we used a div tag with an Id set to CustomerNumber; this identifies it and enables us to extract the inner value and then assign it to our variable. See below for a full code example.

The code above extracts the value from the div element (123456789) and then assigns it to customerId which in turn is then assigned to vi. Once this is assigned, it is available to be viewed in the visit grid within BoldChat.

Passing Custom Variables on Pre-Chat Forms

You can pass custom information to BoldChat using custom variables via Chat Button or VMS code with the WindowParameters directive. The number of custom variables is not limited.

Note: Custom variable values cannot be updated once the chat is started, as opposed to the Conversion Tracking variables mentioned above.
  1. Click New to add a custom parameter to your Chat Window definition under Setup > Account Setup > Chats > Custom Chat Window > Pre-Chat Form > Custom Fields.
  2. Set the field Type to Hidden.
  3. Add the parameter to the VMS or Chat Button code on your page via WindowParameters.
    Important: The variable name must start with customField_.

    Let's say that you need to pass the following additional variables:

    • CampaignID
    • VisitorFromID
    • CreativeID

    In this case, construct the WindowParameters directive as follows, where value1, value2 and value3 are the respective values:

    var WindowParameters="customField_CampaignID=value1&customField_VisitorFromID=value2&customField_CreativeID=value3";
    _bcvma.push(["setParameter", "WindowParameters", WindowParameters]);
Note: Special and unsafe characters must be escaped. With JavaScript, use the encodeURIComponent() method to convert such characters instead of escape(), as it has been deprecated.

Result: The custom variable and the new values now appear in the Chat Details window.