CommonHIT new session example

This is a short example of how to use a single video player, but record multiple, separate interaction sessions.

First, include the YouTube player. Here, we use data-name="lllplayer". Then, whenever you want to start a new session, stop() the player, followed by newSession(log_field_name). For details, see the code at the bottom of the page.

Live heat-map:


Past heat-maps:


Code executed when creating a new session::

// Required: Call stop():
lllplayer.stop();

// Preferably, pick a new name for the log field (initial name is 'events_1'):
var name_counter = lllplayer.log_field_name.split('_');
var new_name = name_counter[0] + '_' + (Number.parseInt(name_counter[1])+1);

var heatmap = LLL.HEATMAP.createHeatmapAndDiv(lllplayer, []);
heatmap.showHeatmapOf(lllplayer);
$('#heatmapList').prepend(heatmap.node);

// Call newSession():
lllplayer.newSession(new_name)