Jacada's Call Intent feature involves mapping a customer's navigation on a website and collecting information about the customer. To use this feature, callintent.js code is added to specific web pages. The information is gathered by collecting key-value pairs of custom variables configured in the callintent.js code and storing them in the Call Intent server.  

When the Interaction is launched from the website, a unique session identifier is passed as a parameter in the Interaction's access URL. This identifier is used to retrieve the values of the variables collected, and populate the Interaction with them. 

Note: For a more detailed description of the Call Intent feature and its runtime behavior, refer to Tracking Customer Intent.

Call Intent Configuration Workflow
A high level summary of the required steps involved in configuring call intent is presented in the workflow diagram below. The steps are described in the paragraphs following the figure.

Step 1: Prepare the Interaction
In this preliminary step, verify that the Interaction to be presented on the web page is appropriate and relevant to your business purpose. From the Interaction Designer, create all necessary user variables and add them to the Customer Navigation variable set. For details, refer to Editing Variable Sets.

Step 2: Load the callintent.js
This step involves loading the callintent.js code into your web page. The code should be added to the head of your page, or to the head template of your website. For an example, refer to Enabling Call Intent Functionality (below). 

Step 3: Collect Customer Navigation Data
In this step, key-value pairs of custom variables are defined in the callintent.js code on relevant web pages. The variable names and values are set using the setVars API. During customer navigation, the variables are collected and passed to the Call Intent server, where they are stored.

For more details and an example, refer to setVars API (below).

Step 4: Embed the Interaction
This step involves embedding an iframe containing the relevant Interaction in your web page. This is done by copying the embedded code for the Interaction and adding it to your page. (For details, refer to Sharing and Distributing Interactions).

To enable retrieval of the variables saved during customer navigation, the following additions to the code are required:

  • Using the getId API: This method returns the saved callIntendId, a unique identifier for the current session.
  • Passing the callIntentId URL parameter: This parameter, which is appended to the access URL of the Interaction, allows the Interaction to use the set variables.

For more information and an example, refer to getId API and Starting the Interaction (below).

The following sections provide details about building Call Intent functionality into a web page, and describe the APIs that are involved.

Enabling Call Intent Functionality
In order to be able to use the Call Intent APIs, you need to load the jQuery library and the callintent.js code into your web pages. For example:

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
<script src="https://gointeract.io/webselfservice/callintent/callintent.1.0.js"></script>

The callIntent Object
This object wraps all the functionality used by the client to invoke Call Intent APIs against the Call Intent server. Members of the callIntent object are listed and described in the table below.

The properties of the callIntent object may be overridden before you using the setVars API. The new values will then be used for all consecutive calls to the API on the same HTML page. However, for subsequent pages, you will need to set these values again.

MemberTypeDescription/Notes
defaultBaseUrl Property The location of the Call Intent server. The default setting is
https://gointeract.io
applicationKey Property The application key of the Public API Service application.
tenantId Property The account identifier used for the API.
setVars Method Sets variables to the Call Intent server.
getVars Method Gets the variables associated with the call intent Id. This function is generally invoked against the Interact server.
getId Method Gets the callIntent id stored in the cookie of the website.

setVars API
The following function sets the variables to be collected and stored:

callIntent.setVars(options); 

 Parameters of the options object are described in the following table.

Parameter NameTypeDescription/NotesDefault Value
baseUrl string The location of the Call Intent server. https://gointeract.io
applicationKey string The application key of the Public API Service application. The value that was sent to the callIntent object.
tenantId string The client (account) identifier. The value that was sent to the callIntent object.
data customVarSetarray The array of key/value pairs passed to the Call Intent server.  
id string The callIntent id generated by the server upon the first call to this API. The value is stored in the cookie from previous calls, so if a cookie exists, this parameter is ignored.  
success function Callback function when the call is successful. The function returns the calIntent id in the argument.
This parameter is optional.
 
error function Callback function when the call fails. 
This parameter is optional.
 

Parameters of the varset element are described in the following table.

Parameter NameTypeDescription
key string Name of the variable.
value string Value of the variable.

The following example shows how you can collect variables according to user activity. If the user clicks on Shopping, the value of the interest variable is set to Shopping. However, if the user clicks on Support, the value of the interest variable is set to Support. 

$(document).on('ready', function() { 
callIntent.defaultBaseUrl = "https://gointeract.io";

callIntent.tenantId ="demoAccount";
callIntent.applicationKey= "53736d34e4b05772e6475ae5";

$('#setShoppingVars').click(function () {

callIntent.setVars({
data : [
{"key": "Longitude","value": "123"},
{"key": "Latitude","value": "456"},
{"key": "interest","value": "Shopping"},
{"key": "Navigation Current Page","value": "Main"},
{"key": "Navigation Start Time","value": new Date().getTime()}
],

success : function (intentId) {
$('#output').html(intentId);
}
});
});

$('#setSupportVars').click(function () {
callIntent.setVars({
data :
[
{"key": "Longitude","value": "789"},
{"key": "Latitude","value": "000"},
{"key": "interest","value": "Support"},
{"key": "Navigation Current Page","value": "Main"},
{"key": "Navigation Start Time","value": new Date().getTime()}
],
success : function (intentId) {
$('#output').html(intentId);
}
});
});

getId API and Starting the Interaction 
The following function returns the currently saved callIntendId from the saved cookie (if such a cookie exists). You need to use this id when starting an Interaction by passing it as a URL parameter.

callIntent.getId() 

In order to enable the Interaction to use the variables set with the setVars function, a callIntentId URL parameter need to be passed to the iframe containing the client. For example:

$('#start').click(function(){ 
console.log(callIntent.getId());
$('iframe').attr('src','https://gointeract.io/webselfservice/start.html?appkey=53736d34e4b05772e6475ae5
&accountId=demoAccount&interaction=1406447961796-2861237f75836eac37512356617e14776c9761a-3c2e
&embedded=true&showTabs=false&showSearch=false&historySearchId=kkk&callIntentId=' + callIntent.getId());
});

getVars API
The following function returns all the variables that were set by calling the setVars API:

callIntent.getVars(options); 

Parameters of the options object are described in the following table.

Parameter NameTypeDescription/NotesDefault Value
baseUrl string The location of the Call Intent server. https://gointeract.io
applicationKey string The application key of the Public API Service application. The value that was sent to the callIntent object.
tenantId string The client (account) identifier. The value that was sent to the callIntent object.
id string The callIntent id generated by the server upon the first call to this API. The value is stored in the cookie from previous calls, so if a cookie exists, this parameter is ignored.  
success function Callback function when the call is successful. The function returns the callIntent id in the argument.
The array of variable sets is returned with the callback.
 
error function Callback function when the call fails. 
This parameter is optional.
 

For example:

$('#getVars').click(function () { 
callIntent.getVars({
baseUrl:"https://gointeract.io",

tenantId: "demoAccount",
appkey: "de44858c-142c-48ee-af88-12a0a500a8e3",
success : function (d) {
$('#output1').html(JSON.stringify(d));
}

 

Revision:

Comments