Skip to content

Instantly share code, notes, and snippets.

@MattJermyWright
Last active January 22, 2020 17:43
Show Gist options
  • Save MattJermyWright/c00db269abf74b50727672642bc902a6 to your computer and use it in GitHub Desktop.
Save MattJermyWright/c00db269abf74b50727672642bc902a6 to your computer and use it in GitHub Desktop.
HPE: Decibel code
/* global sessionStorage decibelInsight s digitalData utag_data */
(function (s) {
var enable = false
try {
enable = location.hostname.indexOf('www.hpe.com')!==-1 && digitalData.page.pageInfo.technology_stack.indexOf('AEM') > -1
} catch (e) {}
if (enable) {
digitalData.log.info('***Decibel Adobe Integrate: enable detected, starting to execute plugin')
s.maxDelay = 750
s.loadModule('Integrate')
s.Integrate.onLoad = function (s) {
digitalData.log.info('***Decibel Adobe Integrate: starting integrate onload')
var eVar = 'eVar127'
var diPropertyId = '280307'
if (sessionStorage && sessionStorage._da_da_sessionId) {
s[eVar] = 'di-' + diPropertyId + '-' + sessionStorage._da_da_sessionId
} else {
s.Integrate.add('DecibelInsight')
s.Integrate.DecibelInsight.sessionVar = eVar
s.Integrate.DecibelInsight.setVars = function (s, p) {
if (typeof decibelInsight.getSessionId === 'function') {
s[p.sessionVar] = decibelInsight.getSessionId()
}
}
if (typeof decibelInsight === 'undefined' || typeof decibelInsight.getSessionId !== 'function') {
s.Integrate.DecibelInsight.delay()
}
}
digitalData.log.info('***Decibel Adobe Integrate: done integrate onload')
}
digitalData.log.info('***Decibel Adobe Integrate: finished with plugin')
}
})(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment