Integrating with Piwik Analytics

You can import sessions from SessionCam into your Piwik Analytics dashboard. Importing sessions into Piwik Analytics means you can view sessions based on existing Piwik Analytics segments.


Importing SessionIDs into Piwik Analytics and viewing playback requires 3 simple steps:

 

1. Add additional code snippet

The snippet you require depends on the version of Piwik Analytics you’re using and must be placed after the main SessionCam and Piwik Analytics tags.

<script type="text/javascript">
setTimeout('setSessionID()',5000);
function setSessionID() {
if(typeof window.sessionCamRecorder != 'undefined') {
if(window.sessionCamRecorder.sessionId().length > 2) {
_paq.push(['setCustomVariable', 1, "SessionCamID", sessionCamRecorder.sessionId(), "visit" ]);
_paq.push(['trackPageView']);
}
else
{
setTimeout('setSessionID()', 100);
}
}
else
{
setTimeout('setSessionID()', 100);
}
}
</script>

 

2. Accessing SessionID in Piwik Analytics dashboard

SessionIDs are imported as a custom variable, which are available when accessing the reports in Piwik Analytics.

You can view the Custom Variable set against a visit by going to the "Visitors tab" and then selecting the "Visitor Log". Alternatively you can view the "Custom Variables" section to view a report on all the variables you have set.

3. Viewing reports and playback

Once you have SessionIDs available you will be able to access a replay directly.
 
The SessionID will look something like this
f3f34551-7ba0-4f9a-a8ac-8683ea74a341,634821081340000000
 
To view a specific session in SessionCam, simply log into the SessionCam console and then paste the playback URL into your browser (https://console.sessioncam.com/Dashboard/Playback/?SessionId=xxxx) and replace "xxxx" in the URL with the SessionID you wish to play.