Send Skilljar student registration and training data directly to Heap via Javascript-based events available in the Theming section of the Dashboard.
You can capture student data automatically, such as first name, last name, email address, and job title. You can also capture search words that students populate in the Skilljar search bar, further identifying what topics students want to learn more about.
Add general tracking
- Open your Skilljar dashboard and select Themeing, or expand the Themeing header on the left and then select Themes.
- Select the theme you want to manage from the list.
- Scroll down and select the Code Snippets header to reveal the snippet fields.
- In the Global Code Snippet, copy and paste the below code.
- Replace ‘YOUR_APP_ID’ in the code with your Heap App ID.
- Scroll to the bottom of the theme page and select:
- “Save and Continue Editing” to stay on the page.
- “Save” to be redirected to the “Themes” page.
<script type="text/javascript">
window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=t.forceSSL||"https:"===document.location.protocol,a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=(r?"https:":"http:")+"//cdn.heapanalytics.com/js/heap-"+e+".js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n);for(var o=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","resetIdentity","removeEventProperty","setEventProperties","track","unsetEventProperty"],c=0;c<p.length;c++)heap[p[c]]=o(p[c])};
heap.load("YOUR_APP_ID");
</script>
Add both general and lead tracking
- Open your Skilljar dashboard and select Themeing, or expand the Themeing header on the left and then select Themes.
- Select the theme you want to manage from the list.
- Scroll down and select the Code Snippets header to reveal the snippet fields.
- In the Global Code Snippet, copy and paste the below code.
- Replace ‘YOUR_APP_ID’ in the code with your Heap App ID.
- Scroll to the bottom of the theme page and select:
- “Save and Continue Editing” to stay on the page
- “Save” to be redirected to the “Themes” page.
<script type="text/javascript">
window.heap=window.heap||[],heap.load=function(e,t){window.heap.appid=e,window.heap.config=t=t||{};var r=t.forceSSL||"https:"===document.location.protocol,a=document.createElement("script");a.type="text/javascript",a.async=!0,a.src=(r?"https:":"http:")+"//cdn.heapanalytics.com/js/heap-"+e+".js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n);for(var o=function(e){return function(){heap.push([e].concat(Array.prototype.slice.call(arguments,0)))}},p=["addEventProperties","addUserProperties","clearEventProperties","identify","resetIdentity","removeEventProperty","setEventProperties","track","unsetEventProperty"],c=0;c<p.length;c++)heap[p[c]]=o(p[c])};
heap.load("YOUR_APP_ID");
try {
heap.identify(skilljarUser.email);
heap.addUserProperties({'Name': skilljarUser.name})}
catch(noUserInfo) {}
</script>
Add conversion tracking
- Open your Skilljar dashboard and select Themeing, or expand the Themeing header on the left and then select Themes.
- Select the theme you want to manage from the list.
- Scroll down and select the Code Snippets header to reveal the snippet fields.
- In the Global Code Snippet, copy and paste the below code.
- Scroll to the bottom of the theme page and click:
- “Save and Continue Editing” to stay on the page
- “Save” to be redirected to the “Themes” page.
<script type="text/javascript">
heap.track('Skilljar Purchase', skilljarPurchase);
</script>
Add course completion tracking
- Open your Skilljar dashboard and select Themeing, or expand the Themeing header on the left and then select Themes.
- Select the theme you want to manage from the list.
- Scroll down and select the Code Snippets header to reveal the snippet fields.
- In the Global Code Snippet, copy and paste the below code.
- Scroll to the bottom of the theme page and click:
- “Save and Continue Editing” to stay on the page
- “Save” to be redirected to the “Themes” page.
<script type="text/javascript">
if(typeof flattenObject == "undefined")
{
var flattenObject = function(ob) {
var toReturn = {};
for (var i in ob) {
if (!ob.hasOwnProperty(i) || i=="data" ) continue;
if ((typeof ob[i] == 'object') && !(ob[i] instanceof HTMLElement)) {
var flatObject = flattenObject(ob[i]);
for (var x in flatObject) {
if (!flatObject.hasOwnProperty(x)) continue;
if (!isNaN(i))
toReturn[x] = flatObject[x];
else
toReturn[i + '.' + x] = flatObject[x];
}
} else {
toReturn[i] = ob[i];
}
}
return toReturn;
};
}
var courseInfo = {
id: skilljarCourse.id,
publishedCourseId: skilljarCourse.publishedCourseId,
title: skilljarCourse.title
}
var dataToTrack = flattenObject(courseInfo);
heap.track('Skilljar Course Completed', dataToTrack);
</script>
Extra Reading
- Adding Web Analytics, Conversion Tracking, Completion Tracking or Custom Javascript
- Heap Docs, Web Installation Guide
- Heap Docs, Using Identity
- Heap Docs, API Endpoints (identify and addUserProperties client-side API endpoints)