SessionCam

We do not have an integration to record the sessionCam replay link directly, but by using the following script it is possible to make this data available for our surveys to pick up. This article will explain how to get the data and how to add it to the feedback that your customers leave.

Prerequisites

Make sure that both the Mopinion deployment script and the sessionCam script are being loaded on the page. The following code must also be added to the page. This can be done using a tag manager or by hosting this script and then linking to it.

The code snippet

 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 // Global object to keep track of sessionCam data var mopSessionCam = {}; mopSessionCam.sessionId = ''; mopSessionCam.sessionCamReplayLink = ''; // event to update website data elements if survey is already loaded const updateWebsiteData = new CustomEvent('mopinion_data'); // Use SC recorder data if already loaded if (window.sessionCamRecorder && window.sessionCamRecorder.sessionId()) { mopSessionCam.sessionId = window.sessionCamRecorder.sessionId(); mopSessionCam.sessionCamReplayLink = `https://console.sessioncam.com/Console/Recordings/PlaybackSession?sessionId=${window.sessionCamRecorder.sessionId()}`; document.dispatchEvent(updateWebsiteData); } scsessionstarted = function(sc) { // update keys on global object when sessionId becomes available after initialization of this script mopSessionCam.sessionId = sc.sessionId; mopSessionCam.sessionCamReplayLink = `https://console.sessioncam.com/Console/Recordings/PlaybackSession?sessionId=${sc.sessionId}`; document.dispatchEvent(updateWebsiteData); }; if(!window.sessioncamConfiguration) { window.sessioncamConfiguration = new Object(); } sessioncamConfiguration.notifications = [{ event: 'session/started', listener: scsessionstarted }];

Website data element

In the surveys that you want to enrich with the sessionCam replay data, you’ll need to add a website data element.

This website data element should listen to the JS variable mopSessionCam.sessionCamReplayLink:

You can also add the sessionCam sessionId by adding the mopSessionCam.sessionId as a separate JS variable datapoint.

Feedback result

 

If there is a sessionCam sessionId when a user leaves feedback the following link will be created and added to the feedback item if the above steps have been implemented.