Professional Documents
Culture Documents
index += 1;
if (lazyLoadState[nextSource] === 'done') {
loadNext();
} else {
addToHead(nextSource, loadNext);
}
};
// start
loadNext();
});
}
(function () {
var GTM_DEBUG = false;
var MESG_PREFIX = "[GTM-Data]";
try {
// Sets up data for Google Tag Manager
GTM_DEBUG_MESG('Creating dataLayer');
window.dataLayer = window.dataLayer || [];
if (window.__CH_PERSON) {
dataLayer.push({
'User ID': window.__CH_PERSON.id,
'User Email': window.__CH_PERSON.email,
'User Name': window.__CH_PERSON.username,
'isVerifiedEducator': window.__CH_PERSON.isVerifiedEducator,
'isNewlyVerified': window.__CH_PERSON.isNewlyVerified,
'isApprovedExpert': window.__CH_PERSON.isApprovedExpert,
'approvedExpertType': window.__CH_PERSON.approvedExpertType,
'dimension2': window.__CH_PERSON.dimension2,
'dimension3': window.__CH_PERSON.dimension3,
'dimension4': window.__CH_PERSON.dimension4,
'dimension5': window.__CH_PERSON.dimension5
});
}
if (window.__CH_RECORD_SESSION) {
var triggers = window.__CH_RECORD_SESSION.triggers || [];
dataLayer.push({
'recordingTriggers': triggers
});
if (triggers.length) {
dataLayer.push({
'event': 'record-session'
});
}
}
if (window.__CH_WEBSERVER_NAME) {
dataLayer.push({
'Webserver Name': window.__CH_WEBSERVER_NAME
});
}
} catch (error) {
if (typeof (console) !== 'undefined') {
console.error(MESG_PREFIX + " ERROR: " + error);
}
}
// Helper Functions
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g,
" "));
}