window.dataLayer = window.dataLayer || [];
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','G-4699REKRC5');
// ANALYTICS/TIMING UTIL METHODS
/**
* options: {
* enableLogs: Boolean,
* intervalFrequency: Number,
* logIdentifier: String,
* maxIterations: Number,
* onSuccess: () => void,
* successCheck: () => Boolean,
* }
*/
function waitForX(options) {
var log = function log() {
if (options.enableLogs)
console.log.apply(console, arguments)
}
var logSuffix = options.logIdentifier ? ' -- [' + options.logIdentifier + ']' : ''
var intervalFrequency = options.intervalFrequency || 100
var maxIterations = options.maxIterations || 100
// Do 1 immediate check before the interval starts.
if (options.successCheck()) {
log('SUCCESS (immediate), no interval needed' + logSuffix)
options.onSuccess()
return;
}
log('every ' + intervalFrequency + 'ms, for ' + intervalFrequency * maxIterations + 'ms' + logSuffix)
var iterations = 0
var waitTimer = window.setInterval(function () {
if (options.successCheck.apply(options)) {
log('SUCCESS, waited: ' + ((iterations + 1) * intervalFrequency) + 'ms (' + (iterations + 1) + ' iterations)' + logSuffix)
options.onSuccess.apply(options)
window.clearInterval(waitTimer);
log('cleared interval' + logSuffix)
}
if (iterations >= maxIterations) {
log('TIMED OUT' + logSuffix)
// Safety net to ensure this interval won't run forever.
window.clearInterval(waitTimer)
log('cleared interval' + logSuffix)
}
iterations++
}, options.intervalFrequency)
}
if(( window.location.pathname || '').includes('/session/'))
{
window.test = data
const { attendee } = data;
const key = Object.keys(attendee)[0]
const value = attendee[key]
waitForX({
intervalFrequency: 100,
maxIterations: 150,
onSuccess: function () {
var deepLinks = document.getElementsByClassName('attribute-ViewDigitalPresentation')
for(let link of deepLinks)
{
var anchor = link.getElementsByTagName('a')
if(!anchor[0].href.includes('ct=' + value))
anchor[0].href += '&ct=' + value;
}
},
successCheck: function () {
console.log('attempting..')
return document.getElementsByClassName('attribute-ViewDigitalPresentation').length != 0;
},
})
}
window.dataLayer = window.dataLayer || [];
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','G-4699REKRC5');