Jaco Analytics

Suggest Edits

init

The init call is used to initialize the "Jaco recorder" and optionally to start a recording

 

By default, once the snippet is loaded it will invoke an init API call.
Alternatively, you can remove the init call from the snippet and add it manually inside your code to start the recording when you need.

window.JacoRecorder.init(apiToken, config, callback(err, sessionInfo));
Name
Type
Description
Notes

apiToken

string

A unique API Token given to each Jaco account.

required

config

Object:

  • startRecordingOnInit: boolean, default: true

When set to true, JacoRecorder will start recording once the init is complete.
When set to false, recording will have to be started manually by calling startRecording.

optional

callback

callback function -

  • err (?object): if init throws an error, an object containing all of the error's information will be passed. Otherwise it'll be null.
  • sessionInfo (object) This object contains three properties:
    • id (string): A unique identifier hash to the current session.
    • startTime (number): Unix timestamp of the first init call for the current session.
    • sessionUrl (string): A URL address pointing to the current session's playback in Jaco.

optional

 

By default Jaco generates a unique anonymous username to each new user the system encounters, names such as "Green Toucan 1". Usually, when using Jaco, you'll want to associate some internal user identification to the Jaco Session.

The identify API call allows you to attach a unique identifier to a user,
Assigning the same identity to a user on a separate device/browser will associate the session to the existing Jaco user with that identity.

window.JacoRecorder.identify(userID, callback);
Name
Type
Description
Notes

userID

string

A unique user identifier (e.g - "user@email.com").

callback

callback function

A callback function that will be invoked once the identify function is complete. The callback function accepts one parameter:

optional

Changing user identity mid-session

To change a user's identity you must first remove their existing association by calling removeUserTracking.

Anonymous user names

Users that didn't receive an identifier via the identify API call will be assigned with random parrot name instead (e.g - Red Macaw 3)

Suggest Edits

removeUserTracking

 

Removes all user-tracking and identification from the current user cookie.
This API call does several things:

  • Finishes current session recorded - To avoid complex identification scenarios, we automatically stop a session recording after you call the removeUserTracking API
  • Removes all user identification for the current user, effectively marking him as a totally new user for any new session(unless you call identify again)
window.JacoRecorder.removeUserTracking();

Login flow

Make sure to call identify as part of your "log in" function and removeUserTracking followed by init as part of your "log out" function. This will ensure that every session is coupled with the right user.

Logout flow

A common use-case for the removeUserTracking API call is during the logout flow - You should call removeUserTracking right after the user successfully logged out.
You should also think about starting a new recording for the user if he keeps using your system after being logged out.

Start a new recording after calling removeUserTracking

To start recording a new session call the init API again. After the init call, you may call the identify API with a new value.

Suggest Edits

stopRecording

Use stopRecording to stop recording mid-session.

 

You can use stopRecording to pause a recording

window.JacoRecorder.stopRecording();

Page refresh

Note that this call does not stop the session on the server, it only stops the current page recording, once the user refreshes, or visit your application recording the session might resume.

Suggest Edits

Session Attributes

 

You can associate attributes to each session in Jaco and later on use these attributes to filter and segments sessions in the Jaco Backoffice

Suggest Edits

setAttribute

 

Add custom attributes to your sessions for enhanced segmentation capabilities.

window.JacoRecorder.push(['session.setAttribute', {
 attributeName: 'my_first_attribute', attributeValue: ['value_1', 'value_2', 'value_3']
}, function (err) {
 if (err) {
   console.error('error setting attribute');
 }
}]);

Each attribute can have multiple values.

Suggest Edits

getAttributes

 

Get all custom attributes attached to the current session.

window.JacoRecorder.push(['session.getAttributes', function (err, attributes) {
  if (err) {
    console.error('error getting attribute');
  } else {
    console.log(attributes);
  }
}]);

This will also return attributes that were auto generated by integrations.

Suggest Edits

startRecording

 

Use startRecording to manually start a recording if you're using the manual variant of the init() call or resume a recording after a stopRecording call was made.

window.JacoRecorder.startRecording();