full-napkin-56745
11/24/2022, 12:50 PMgentle-petabyte-80785
11/24/2022, 3:26 PMfull-napkin-56745
11/24/2022, 4:14 PMfull-napkin-56745
11/24/2022, 4:14 PMfull-napkin-56745
11/24/2022, 4:15 PMfull-napkin-56745
11/24/2022, 4:15 PMfull-napkin-56745
11/24/2022, 4:16 PMfull-napkin-56745
11/24/2022, 4:16 PMgentle-petabyte-80785
11/24/2022, 4:29 PMfull-napkin-56745
11/24/2022, 4:30 PMfull-napkin-56745
11/24/2022, 4:30 PMfull-napkin-56745
11/24/2022, 4:30 PMfull-napkin-56745
11/24/2022, 4:31 PMfull-napkin-56745
11/24/2022, 4:32 PMfull-napkin-56745
11/24/2022, 4:32 PMfull-napkin-56745
11/24/2022, 4:33 PMfull-napkin-56745
11/24/2022, 4:33 PMfull-napkin-56745
11/24/2022, 4:34 PMfull-napkin-56745
11/24/2022, 4:34 PMfull-napkin-56745
11/24/2022, 4:34 PMgentle-petabyte-80785
11/24/2022, 4:35 PMfull-napkin-56745
11/24/2022, 4:37 PMgentle-petabyte-80785
11/24/2022, 4:37 PMfull-napkin-56745
11/24/2022, 4:37 PMfull-napkin-56745
11/24/2022, 4:37 PMgentle-petabyte-80785
11/24/2022, 4:38 PMgentle-petabyte-80785
11/24/2022, 4:39 PMgentle-petabyte-80785
11/24/2022, 4:39 PMfull-napkin-56745
11/24/2022, 4:39 PMfull-napkin-56745
11/24/2022, 4:40 PMfull-napkin-56745
11/24/2022, 4:40 PMfull-napkin-56745
11/24/2022, 4:41 PMfull-napkin-56745
11/24/2022, 4:41 PMfull-napkin-56745
11/24/2022, 4:43 PMfull-napkin-56745
11/24/2022, 4:43 PMfull-napkin-56745
11/24/2022, 4:43 PMfull-napkin-56745
11/24/2022, 4:43 PMfull-napkin-56745
11/24/2022, 4:44 PMgentle-petabyte-80785
11/24/2022, 4:46 PMfull-napkin-56745
11/24/2022, 4:46 PMgentle-petabyte-80785
11/24/2022, 4:46 PMfull-napkin-56745
11/24/2022, 4:46 PMfull-napkin-56745
11/24/2022, 4:47 PMgentle-petabyte-80785
11/24/2022, 4:47 PMfull-napkin-56745
11/24/2022, 4:47 PMfull-napkin-56745
11/24/2022, 4:47 PMfull-napkin-56745
11/24/2022, 4:47 PMfull-napkin-56745
11/24/2022, 4:47 PMfull-napkin-56745
11/24/2022, 4:48 PMfull-napkin-56745
11/24/2022, 4:48 PMfull-napkin-56745
11/24/2022, 4:48 PMfull-napkin-56745
11/24/2022, 4:48 PMfull-napkin-56745
11/24/2022, 4:48 PMgentle-petabyte-80785
11/24/2022, 4:48 PMfull-napkin-56745
11/24/2022, 4:49 PMfull-napkin-56745
11/24/2022, 4:49 PMfull-napkin-56745
11/24/2022, 4:49 PMfull-napkin-56745
11/24/2022, 4:49 PMfull-napkin-56745
11/24/2022, 4:49 PMfull-napkin-56745
11/24/2022, 4:49 PMfull-napkin-56745
11/24/2022, 4:50 PMfull-napkin-56745
11/24/2022, 4:50 PMfull-napkin-56745
11/24/2022, 4:50 PMfull-napkin-56745
11/24/2022, 4:50 PMfull-napkin-56745
11/24/2022, 4:50 PMgentle-petabyte-80785
11/24/2022, 4:52 PMfull-napkin-56745
11/24/2022, 4:52 PMfull-napkin-56745
11/24/2022, 4:52 PMfull-napkin-56745
11/24/2022, 4:53 PMfull-napkin-56745
11/24/2022, 4:53 PMfull-napkin-56745
11/24/2022, 4:53 PMfull-napkin-56745
11/24/2022, 4:53 PMfull-napkin-56745
11/24/2022, 4:54 PMfull-napkin-56745
11/24/2022, 4:54 PMgentle-petabyte-80785
11/24/2022, 4:55 PMfull-napkin-56745
11/24/2022, 4:55 PMfull-napkin-56745
11/24/2022, 4:55 PMgentle-petabyte-80785
11/24/2022, 4:59 PMgentle-petabyte-80785
11/24/2022, 5:02 PMfull-napkin-56745
11/24/2022, 5:03 PMfull-napkin-56745
11/24/2022, 5:04 PMfull-napkin-56745
11/24/2022, 5:04 PMfull-napkin-56745
11/24/2022, 5:04 PMfull-napkin-56745
11/24/2022, 5:04 PMgentle-petabyte-80785
11/24/2022, 5:08 PMfull-napkin-56745
11/24/2022, 5:10 PMfull-napkin-56745
11/24/2022, 5:10 PMfull-napkin-56745
11/24/2022, 5:10 PMfull-napkin-56745
11/24/2022, 5:10 PMfull-napkin-56745
11/24/2022, 5:11 PMgentle-petabyte-80785
11/24/2022, 5:11 PMfull-napkin-56745
11/24/2022, 5:11 PMfull-napkin-56745
11/24/2022, 5:11 PMfull-napkin-56745
11/24/2022, 5:12 PMgentle-petabyte-80785
11/24/2022, 5:12 PMfull-napkin-56745
11/24/2022, 5:12 PMfull-napkin-56745
11/24/2022, 5:12 PMfull-napkin-56745
11/24/2022, 5:12 PMfull-napkin-56745
11/24/2022, 5:13 PMfull-napkin-56745
11/24/2022, 5:13 PMfull-napkin-56745
11/24/2022, 5:13 PMfull-napkin-56745
11/24/2022, 5:13 PMfull-napkin-56745
11/24/2022, 5:13 PMfull-napkin-56745
11/24/2022, 5:16 PMlet trackedSet = [];
let formsToNotTrack = [];
let rdTracker = {
hasClickedOnLink: false,
isAboutToRefresh: false,
hasMouseLeftWindow: false,
hasInactivityTracked: false,
};
const linksToTrack = document.querySelectorAll("a[href]");
linksToTrack.forEach(link => {
if ( trackedSet.includes(link) ) {
return ;
}
const href = link.getAttribute("href");
if ( !href || href === "javascript:void(0)" ) {
return ;
}
link.addEventListener("click", event => {
event.preventDefault();
trackThisLink(link);
});
trackedSet.push(link);
});
function trackThisLink(link) {
if ( !link ) {
return ;
}
let linkData = {};
let href = link.getAttribute("href");
if ( /^#/.test(href) ) {
linkData = intraLinkData(link);
}
else {
if ( /^\//.test(href) ) {
linkData = interLinkData(link);
}
else {
href = new URL(href);
if ( href.origin === window.location.origin ) {
linkData = interLinkData(link);
}
else {
linkData = externalLinkData(link);
}
}
}
sendTrackedLinkData(link, linkData);
}
function intraLinkData(link) {
const href = link.getAttribute("href");
const title = getLinkElementTitle(link);
return {
"type": "intra",
"linkTitle": title,
"destinationId": href,
"meta": {
"id": link.getAttribute("id") || "",
"classes": link.getAttribute("class") || "",
"_parent": {
"id": link.parentElement.getAttribute("id") || "",
"classes": link.parentElement.getAttribute("class") || "",
},
},
};
}
function getLinkElementTitle(link) {
let title = link.getAttribute("title");
title = title || link.textContent;
const img = link.querySelector("img");
if ( img ) {
title = title || img.getAttribute("alt");
}
title = title || "N/A - Link text is unknown";
return title.trim();
}
function interLinkData(link) {
const href = link.getAttribute("href");
const title = getLinkElementTitle(link);
const newTab = link.getAttribute("target") === "_blank";
return {
"type": "internal",
"linkTitle": title,
"destination": href,
"destinationPath": new URL(href, window.location.origin).pathname,
"newTab": newTab,
"meta": {
"id": link.getAttribute("id") || "",
"classes": link.getAttribute("class") || "",
"_parent": {
"id": link.parentElement.getAttribute("id") || "",
"classes": link.parentElement.getAttribute("class") || "",
},
},
};
}
function externalLinkData(link) {
const href = link.getAttribute("href");
const title = getLinkElementTitle(link);
const newTab = link.getAttribute("target") === "_blank";
const relAttribute = link.getAttribute("rel").toLowerCase();
return {
"type": "external",
"linkTitle": title,
"destination": href,
"destinationOrigin": new URL(href).origin,
"newTab": newTab,
"isNoFollow": relAttribute.includes("nofollow"),
"isSponsored": relAttribute.includes("sponsored"),
"isNoReferer": relAttribute.includes("noreferer"),
"meta": {
"id": link.getAttribute("id") || "",
"classes": link.getAttribute("class") || "",
"_parent": {
"id": link.parentElement.getAttribute("id") || "",
"classes": link.parentElement.getAttribute("class") || "",
},
},
};
}
function sendTrackedLinkData(link, linkData) {
try {
rudderanalytics.track( 'linkClicked', linkData, simulateLinkClick(link) );
}
catch(_) {
simulateLinkClick(link);
}
}
function simulateLinkClick( link ) {
if ( link.href ) {
link.target === '_blank'
? window.open(link.href, '_blank')
: window.location.href = link.href;
}
}
window.addEventListener("scroll", function(_) {
var h = document.documentElement,
b = document.body,
st = 'scrollTop',
sh = 'scrollHeight';
var percent = (h[st]||b[st]) / ((h[sh]||b[sh]) - h.clientHeight) * 100;
if (percent >= 24.99 && !trackedSet.includes('scrolled-25')) {
trackScrollEvent('scrolled-25');
}
else if (percent >= 49.99 && !trackedSet.includes('scrolled-50')) {
trackScrollEvent('scrolled-50');
}
else if (percent >= 74.99 && !trackedSet.includes('scrolled-75')) {
trackScrollEvent('scrolled-75');
}
else if (percent >= 99.00 && !trackedSet.includes('scrolled-100')) {
trackScrollEvent('scrolled-100');
}
});
function trackScrollEvent(eventName) {
try {
rudderanalytics.track( eventName, {} );
}
catch(_) {}
finally {
trackedSet.push(eventName);
}
}
window.onload = function() {
var trackDates = {
'datePublished': '',
'dateModified': ''
};
document.querySelectorAll("script[type='application/ld+json']")
.forEach(function(script) {
var jsonString = script.innerHTML;
var json = JSON.parse(jsonString);
if ( json ) {
if ( json.hasOwnProperty("dateModified") ){
trackDates['dateModified'] = json['dateModified'];
}
if ( json.hasOwnProperty('datePublished') ) {
trackDates['datePublished'] = json['datePublished'];
}
}
});
rudderanalytics.page( document.title, trackDates );
if ( !sessionStorage.tabID ) {
sessionStorage.tabID = Math.floor(Math.random() * 10e9);
}
const url = window.location.protocol + '//' + window.location.host + window.location.pathname;
const hashedUrl = Math.abs(hashString(url));
let pageHistoryStack = sessionStorage.getItem("pageHistory") || '[]';
pageHistoryStack = JSON.parse(pageHistoryStack);
let pageHistoryStackSize = sessionStorage.getItem("pageHistoryStackSize") || "0";
pageHistoryStackSize = parseInt(pageHistoryStackSize);
if ( pageHistoryStack.length <= 0 ) {
beginUserJourney();
pageHistoryStack.push(hashedUrl);
}
else {
trackUserEnRoute( pageHistoryStackSize > pageHistoryStack.length );
if ( pageHistoryStack[pageHistoryStack.length - 1] !== hashedUrl ) {
pageHistoryStack.push(hashedUrl);
}
}
sessionStorage.setItem("pageHistory", JSON.stringify(pageHistoryStack));
sessionStorage.setItem("pageHistoryStackSize", pageHistoryStack.length);
};
function hashString(str) {
return str.split('').reduce((prevHash, currVal) =>
(((prevHash << 5) - prevHash) + currVal.charCodeAt(0))|0, 0);
}
function beginUserJourney() {
const url = window.location.protocol + '//' + window.location.host + window.location.pathname;
setTimeout(
function() {
rudderanalytics.track(
"userJourneyStarted",
{
anonymousId: rudderanalytics.getAnonymousId(),
prevPage: "",
currPage: window.location.href,
sessionTabId: sessionStorage.tabID,
}
);
sessionStorage.setItem("currPage", url);
},
500
);
}
function trackUserEnRoute( userClickedBack = false ) {
const url = window.location.protocol + '//' + window.location.host + window.location.pathname;
setTimeout(
function() {
rudderanalytics.track(
"userEnRoute",
{
anonymousId: rudderanalytics.getAnonymousId(),
prevPage: sessionStorage.getItem("currPage") || "",
currPage: window.location.href,
clickedBack: userClickedBack,
sessionTabId: sessionStorage.tabID,
},
function() {
console.log("enRouteTracked:");
}
);
sessionStorage.setItem("currPage", url);
},
500
);
}
document.addEventListener('keydown', function(event) {
if ( event.which == 116 || ( event.which == 82 && event.ctrlKey ) ) {
rdTracker.isAboutToRefresh = true;
}
});
window.onbeforeunload = function() {
let triggeredBy = document.activeElement;
if (
triggeredBy.hasAttribute("href") &&
( /^\//.test( triggeredBy.getAttribute("href") ) ||
triggeredBy.getAttribute("href").startsWith(window.location.origin)
) &&
!rdTracker.isAboutToRefresh &&
!rdTracker.hasMouseLeftWindow
) {
// Do nothing at this point
}
else {
let pageHistoryStack = sessionStorage.getItem("pageHistory") || '[]';
pageHistoryStack = JSON.parse(pageHistoryStack);
if ( pageHistoryStack.length > 0 ) {
pageHistoryStack.pop();
sessionStorage.setItem("pageHistory", JSON.stringify(pageHistoryStack));
}
}
}
document.addEventListener('copy', function(event) {
var selectedText = window.getSelection().toString();
selectedText = selectedText.replace(/\u200B/g, "");
rudderanalytics.track(
"copiedToClipboard",
{
sessionTabId: sessionStorage.tabID,
clipboardText: selectedText,
}
);
});
document.querySelectorAll('form')
.forEach(function(form) {
form.addEventListener('submit', function(event) {
var formId = form.getAttribute('id') || '';
if ( formsToNotTrack.includes(formId) ) {
return ;
}
event.preventDefault();
rudderanalytics.track(
"formSubmit",
{
sessionTabId: sessionStorage.tabID,
formId: formId,
formAction: form.getAttribute('action') || '',
}
);
setTimeout(function() {
HTMLFormElement.prototype.submit.call(form);
}, 1000);
});
});
document.querySelectorAll('input[type=radio], input[type=checkbox')
.forEach(function(input) {
input.addEventListener('change', function() {
rudderanalytics.track(
"radioCheckboxChanged",
{
sessionTabId: sessionStorage.tabID,
inputId: input.getAttribute('id') || '',
inputName: input.getAttribute('name') || '',
isChecked: input.checked,
}
);
});
});gentle-petabyte-80785
11/24/2022, 5:17 PMfull-napkin-56745
11/24/2022, 5:18 PMfull-napkin-56745
11/24/2022, 5:18 PMfull-napkin-56745
11/24/2022, 5:18 PMgentle-petabyte-80785
11/24/2022, 5:18 PMfull-napkin-56745
11/24/2022, 5:18 PMfull-napkin-56745
11/24/2022, 5:27 PMfull-napkin-56745
11/24/2022, 5:27 PMfull-napkin-56745
11/24/2022, 5:27 PMfull-napkin-56745
11/24/2022, 5:27 PMgentle-petabyte-80785
11/24/2022, 5:31 PMfull-napkin-56745
11/24/2022, 5:32 PMfull-napkin-56745
11/24/2022, 5:32 PMfull-napkin-56745
11/24/2022, 5:33 PMfull-napkin-56745
11/24/2022, 5:33 PMfull-napkin-56745
11/24/2022, 5:33 PMfull-napkin-56745
11/24/2022, 5:33 PMfull-napkin-56745
11/24/2022, 5:33 PMfull-napkin-56745
11/24/2022, 5:33 PMfull-napkin-56745
11/24/2022, 5:34 PMfull-napkin-56745
11/24/2022, 5:34 PMfull-napkin-56745
11/24/2022, 5:35 PMfull-napkin-56745
11/24/2022, 5:35 PMfull-napkin-56745
11/24/2022, 5:35 PMfull-napkin-56745
11/24/2022, 5:35 PMfull-napkin-56745
11/24/2022, 5:36 PMfull-napkin-56745
11/24/2022, 5:36 PMgentle-petabyte-80785
11/24/2022, 5:36 PMfull-napkin-56745
11/24/2022, 5:36 PMfull-napkin-56745
11/24/2022, 5:36 PMfull-napkin-56745
11/24/2022, 5:36 PMfull-napkin-56745
11/24/2022, 5:37 PMfull-napkin-56745
11/24/2022, 5:37 PMfull-napkin-56745
11/24/2022, 5:37 PMfull-napkin-56745
11/24/2022, 5:37 PMfull-napkin-56745
11/24/2022, 5:37 PMfull-napkin-56745
11/24/2022, 5:37 PMfull-napkin-56745
11/24/2022, 5:37 PMfull-napkin-56745
11/24/2022, 5:37 PMfull-napkin-56745
11/24/2022, 5:38 PMgentle-petabyte-80785
11/24/2022, 5:40 PM