- Source:
A window-scoped (global) object used to expose or define selected functionality.
Members
(static) .cmpName :string
- Source:
The name of the CMP, provided by extension-2, mostly used for logging and debugging.
Type:
- string
Example
window.tealiumCmpIntegration = window.tealiumCmpIntegration || {}
window.tealiumCmpIntegration.cmpName = 'Usercentrics'
(static) .map :object
- Source:
A map of CMP groups to arrays of Tealium iQ tag UIDs, an instance of GroupToTagMap
. TiQ profile specific, and expected to be provided by extension-1 (map).
Type:
- object
Example
window.tealiumCmpIntegration = window.tealiumCmpIntegration || {}
// the arrays of numbers are tag UIDs from the TiQ user interface
window.tealiumCmpIntegration.map = {
yPyIAIIxY: {
'Google Analytics': [6, 8, 10], // three Google Analytics tags in TiQ
'Another Tag': [11]
}
}
(static) .nameOfConsentTypeString :string
- Source:
- Default Value:
- consent_type
The name to use for the ConsentDecision
's 'type' attribute ('implicit' or 'explicit') when adding it to Tealium's b object on each event.
Type:
- string
(static) .nameOfFullGroupArray :string
- Source:
- Default Value:
- purposes_with_consent_all
The name to use for the full ConsentDecision
array when adding it to Tealium's b object on each event.
Type:
- string
(static) .nameOfProcessedGroupArray :string
- Source:
- Default Value:
- purposes_with_consent_processed
The name to use for the array of already-processed consented groups when adding it to Tealium's b object on each event and in the 'data' property of QueuedEvent
objects.
Type:
- string
(static) .nameOfUnprocessedGroupArray :string
- Source:
- Default Value:
- purposes_with_consent_unprocessed
The name to use for the array of not-yet-processed-but-consented groups when adding it to Tealium's b object on each event and in the 'data' property of QueuedEvent
objects.
Type:
- string
(static) .overrideUtagFunctions :function
- Source:
A helper function
that overrides certain utag functions to allow tags to be blocked based on CMP response.
Must be called directly after the '##UTGEN##' reference by editing the 'utag loader' template, as shown in the example.
Type:
- function
Example
// ... utag loader template ...
##UTGEN##
// override two utag functions for the CMP Integration, to allow tags to be blocked as needed
window.tealiumCmpIntegration && window.tealiumCmpIntegration.overrideUtagFunctions && window.tealiumCmpIntegration.overrideUtagFunctions()
// ... utag loader template continues...
(static) .refiringAllowed :array
- Source:
A list of tags that should refire when the user makes an initial, non opt-out explicit decision on first landing. This example will cause tag 7 to fire any intial events twice, allowing server-side activations to be triggered as early as possible.
Type:
- array
Example
window.tealiumCmpIntegration = window.tealiumCmpIntegration || {}
// the numbers in the array are tag UIDs from the TiQ user interface, this
window.tealiumCmpIntegration.refiringAllowed = [7]
(static) .tiqGroupName :object
- Source:
- Default Value:
- 'Tealium iQ Tag Management'
Profile-specific helper, expected to be provided by extension-2 (and possibly overridden via extension-1). The Group Name for Tealium iQ in the CMP (used to decide if the TMS is allowed to run). Uses a standard name if not provided.
Type:
- object
Example
window.tealiumCmpIntegration = window.tealiumCmpIntegration || {}
window.tealiumCmpIntegration.tiqGroupName = "TiQ"
Methods
(static) .cmpCheckForExplicitConsentDecision(cmpRawOutput) → {boolean}
- Source:
CMP-specific helper, expected to be provided by extension-2. Indicates if the user has made an EXPLICIT decision.
Example
function cmpCheckForExplicitConsentDecision (cmpRawOutput) {
// treat things we don't understand as an opt-out
if (toString.call(cmpRawOutput) !== '[object Array]') return false
// use the first entry as a proxy for all
var consentHistory = (cmpRawOutput && cmpRawOutput[0] && cmpRawOutput[0].consent && cmpRawOutput[0].consent.history) || []
var lastHistoryEntryType = (consentHistory && consentHistory.length && consentHistory[consentHistory.length - 1].type) || ''
if (lastHistoryEntryType === 'explicit') {
return true
}
return false
}
window.tealiumCmpIntegration.cmpCheckForExplicitConsentDecision = cmpCheckForExplicitConsentDecision
Parameters:
Name | Type | Description |
---|---|---|
cmpRawOutput |
the CMP output returned from cmpFetchCurrentConsentDecision |
Returns:
'true' if the consent decision is EXPLICIT otherwise 'false'
- Type
- boolean
(static) .cmpCheckForTiqConsent(cmpRawOutput, tiqGroupName) → {boolean}
- Source:
CMP-specific helper, expected to be provided by extension-2. Indicates if Tealium iQ has permission to run (and fire tags).
Example
function cmpCheckForTiqConsent (cmpRawOutput) {
var foundOptIn = false
// treat things we don't understand as an opt-out
if (toString.call(cmpRawOutput) !== '[object Array]') return false
// check vendors if there's an object, look for at least one
cmpRawOutput.forEach(function (tagInfo) {
if ((tagInfo.consent && tagInfo.consent.status === true) && tagInfo.name === tiqGroupName) {
foundOptIn = true
}
})
return foundOptIn
}
window.tealiumCmpIntegration.cmpCheckForTiqConsent = cmpCheckForTiqConsent
Parameters:
Name | Type | Description |
---|---|---|
cmpRawOutput |
the CMP output returned from cmpFetchCurrentConsentDecision |
|
tiqGroupName |
the Group Name designation for Tealium iQ in the CMP |
Returns:
'true' if TiQ is allowed to run, otherwise 'false'
- Type
- boolean
(static) .cmpCheckForWellFormedDecision(cmpRawOutput) → {boolean}
- Source:
CMP-specific helper, expected to be provided by extension-2. Indicates if the CMP has loaded and returned a well-formed indication of user consent.
Example
function cmpCheckForWellFormedDecision (cmpRawOutput) {
// treat things we don't understand as an opt-out
if (toString.call(cmpRawOutput) !== '[object Array]') return false
// use the first entry as a proxy for all
if (cmpRawOutput && cmpRawOutput[0] && typeof cmpRawOutput[0].name === 'string') {
return true
}
return false
}
window.tealiumCmpIntegration.cmpCheckForWellFormedDecision = cmpCheckForWellFormedDecision
Parameters:
Name | Type | Description |
---|---|---|
cmpRawOutput |
the CMP output returned from cmpFetchCurrentConsentDecision |
Returns:
'true' if the consent decision is well-formed, otherwise 'false'
- Type
- boolean
(static) .cmpCheckIfOptInModel() → {boolean}
- Source:
CMP-specific helper, expected to be provided by extension-2. Indicates if the CMP is running in opt-in (GDPR-like) or opt-out (CCPA-like) mode
Example
function cmpCheckIfOptInModel () {
var decision = cmpFetchCurrentConsentDecision()
if (decision.ConsentModel.Name === 'opt-in') {
return true
}
return false
}
Returns:
true if the CMP is in opt-in mode (like for GDPR), false if opt-out mode (like for CCPA)
- Type
- boolean
(static) .cmpConvertResponseToGroupList(cmpRawOutput) → {array}
- Source:
CMP-specific helper, expected to be provided by extension-2. Indicates if Tealium iQ has permission to run (and fire tags).
Example
function cmpConvertResponseToGroupList (cmpRawOutput) {
var vendorArray = []
cmpRawOutput && cmpRawOutput.forEach(function (tagConsent) {
if (tagConsent.consent && tagConsent.consent.status === true) {
vendorArray.push(tagConsent.name)
}
})
return vendorArray
}
window.tealiumCmpIntegration.cmpConvertResponseToGroupList = cmpConvertResponseToGroupList
Parameters:
Name | Type | Description |
---|---|---|
cmpRawOutput |
the CMP output returned from cmpFetchCurrentConsentDecision |
Returns:
a simple list of the group names with permissions to fire, at the desired granularity
- Type
- array
(static) .cmpFetchCurrentConsentDecision() → {*}
- Source:
CMP-specific helper, expected to be provided by extension-2. Expects a function that gets the current consent decision from the CMP.
Example
function cmpFetchCurrentConsentDecision () {
if (!window.UC_UI || typeof window.UC_UI.getServicesBaseInfo !== 'function') return false
var cmpRawOutput = window.UC_UI.getServicesBaseInfo()
return cmpRawOutput
}
window.tealiumCmpIntegration.cmpFetchCurrentConsentDecision = cmpFetchCurrentConsentDecision
Returns:
The CMP response to use within other CMP-specific functions
- Type
- *