Setting Up Custom Variables

Custom Variables are the mechanism for pushing data from your website/system into SessionCam.  You can push as many data items as you wish, and then within the SessionCam console, you can search for any sessions containing the specific data (for example a reference number).  

 

For each Custom Variable you will need to define it's  Key and the specific Value relevant to the session.

The following is an example script to demonstrate how this can be achieved:

<p>This is just a paragraph</p>
<p>Our Ref: <span id="ourRef">123ABC456</span></p>
<p>That was a reference number, it could be a quote or order reference</p>

<script>
	if (!window.sessioncamConfiguration)
		window.sessioncamConfiguration = new Object();
	if (!window.sessioncamConfiguration.customDataObjects)
		window.sessioncamConfiguration.customDataObjects = [];
	/** You can edit the values below for key and value to send the data you want**/
	var item = {key: "Quote",value: "Generated"};
	window.sessioncamConfiguration.customDataObjects.push(item);
</script>

In the example above, the script sends SessionCam a variable called "Quote" that has a value of "Generated".

This script can be modified to send variables that have values that may be dynamic (i.e. a booking reference number etc.) For example, in the snippet below we are pulling the reference number from our <span> element. This could also be modified to pull values from a data layer.

<p>This is just a paragraph</p>
<p>Our Ref: <span id="ourRef">123ABC456</span></p>
<p>That was a reference number, it could be a quote or order reference</p>

<script>
	if (!window.sessioncamConfiguration)
		window.sessioncamConfiguration = new Object();
	if (!window.sessioncamConfiguration.customDataObjects)
		window.sessioncamConfiguration.customDataObjects = [];
	/** You can edit the values below for key and value to send the data you want**/
	var item = {key: "QuoteRef",value: document.getElementById("ourRef").innerHTML};
	window.sessioncamConfiguration.customDataObjects.push(item);
</script>

 

Additional variables can be sent by duplicating the last 2 lines. For example:

<p>This is just a paragraph</p>
<p>Our Ref: <span id="ourRef">123ABC456</span></p>
<p>That was a reference number, it could be a quote or order reference</p>
<p>Quote Total: £<span id="quoteTotal">352.47</span></p>
<script>
	if (!window.sessioncamConfiguration)
		window.sessioncamConfiguration = new Object();
	if (!window.sessioncamConfiguration.customDataObjects)
		window.sessioncamConfiguration.customDataObjects = [];
	/** You can edit the values below for key and value to send the data you want**/
	var item1 = {key: "QuoteRef",value: document.getElementById("ourRef").innerHTML};
	var item2 = {key: "QuoteTotal",value: document.getElementById("quoteTotal").innerHTML};
	window.sessioncamConfiguration.customDataObjects.push(item1, item2);
</script>

 

This script can be called to pass through a Custom Variable through at any time during the session being recorded. 

 

Debugging a Custom Variable send

In order to check that a Variable is being sent you can interrogate the SaveEvents calls within your browsers development tools (the screenshot below was taken in Chrome). In the Form Data area you will see an item labeled as "tag", the section after is a timestamp, the next section is the "Value", and the final section is the "Name" of the Custom Variable, the different events are separated with a pipe symbol.

 

 

How to use this in the console

In order to filter your recordings by the Custom Variable you can use the Field Value filter in the console, you can find an interactive tutorial demonstrating this below

You can use the export feature to select/export the variable values.