Settings
Learn about the available settings that adjust the behavior of utag.js
.
How It Works
Many of the behaviors of utag.js
are controlled with settings set in the utag.cfg
object. The default behaviors controlled by these settings are overridden using a new object called utag_cfg_ovrd
. To use this object, set it in your page code prior to loading utag.js
or within a JavaScript Code Extension scoped to Pre Loader with the following:
window.utag_cfg_ovrd = window.utag_cfg_ovrd || {};
Settings
The following table summarizes the available settings:
Setting | Description |
---|---|
cmcookiens |
Consent management cookie name. |
consentPeriod |
Set the number of days to retain the user’s consent preference. |
dom_complete |
Delay tags until the DOM complete (load) event. |
domain |
Override the domain used to set cookies. |
gdprDLRef |
Specify the name of the data layer variable which stores the language setting to be used by the consent manager. |
load_rules_ajax |
Disable load rules after page load (legacy). |
load_rules_at_wait |
Run load rules after extensions (legacy). |
lowermeta |
Lower-case meta tag names and values (legacy). |
lowerqp |
Lower-case query string parameter names and values (legacy). |
noload |
Disable all functionality. |
noview |
Disable the automatic tracking call on initial page load. |
nocookie |
Disable the utag_main cookie. |
readywait |
Halt operations until the DOM-ready browser event. |
secure_cookie |
Set the attribute string to secure for all utag_main cookies set by the Persist Data Values extension and the SC() function. |
session_timeout |
Set the session expiration time (in milliseconds). |
waittimer |
Set a time to delay (in milliseconds) before loading tags. |
ignoreLocalStorage |
Ignore localStorage DESCRIPTION |
[ignoreSessionStorage ]{#ignoreSessionStorage} |
Ignore sessionStorage DESCRIPTION |
cmcookiens
Consent Management cookie name
Customize the Consent Management cookie name, which is useful when different profiles share the same domain name.
window.utag_cfg_ovrd.cmcookiens = "CONSENTMGR_NL-CMB-CG1";
consentPeriod
Consent preference retention period
Set the number of days to retain GDPR and CCPA consent status. The built-in expiry is 365 days for GDPR and 395 days for CCPA.
window.utag_cfg_ovrd.consentPeriod = 60;
dom_complete
Delay tags until the DOM complete (load) browser event
Load tags at the document load event rather than at DOM Ready. This also holds back any extensions scoped to DOM Ready. (Default: false
)
window.utag_cfg_ovrd.dom_complete = true;
domain
Override cookie domain
Sets the domain where utag_main
cookie is set. Useful for sites on root domains that won’t accept cookies. For example, amazonaws.com
. (Default: The top-level domain of location.hostname
)
window.utag_cfg_ovrd.domain = "mysite.amazonaws.com";
gdprDLRef
Override language preference in consent manager
Specify the name of the data layer variable which stores the language to be used in the consent manager.
For example, if your data layer contains a variable named site_language
:
window.utag_cfg_ovrd = window.utag_cfg_ovrd || {}
window.utag_cfg_ovrd.gdprDLRef = "site_language";
Do not set the language code directly. This override setting expects a variable name, not a language code value.
ignoreLocalStorage
Ignore local storage variables
Ignores any local storage variables. (Default: false
)
window.utag_cfg_ovrd.ignoreLocalStorage = true;
ignoreSessionStorage
Ignore session storage variables
Ignores any session storage variables. (Default: false
)
window.utag_cfg_ovrd.ignoreSessionStorage = true;
load_rules_ajax
Disable load rules after page load (legacy)
Controls if load rules are reprocessed on each call to utag.view
and utag.link
within the same page load. It’s possible that a newly triggered Load Rule loads a new tag into the page. Use this setting to replicate behavior from versions of utag.js
older than 4.2x. (Default: true
)
window.utag_cfg_ovrd.load_rules_ajax = false;
load_rules_at_wait
Run load rules after extensions (legacy)
Evaluates Load Rules after extensions. Used for older versions of utag.js
and for installations where the data layer object is populated after loading utag.js
. Newer versions of utag.js
make use of extension execution order instead of this setting. (Default: false
)
window.utag_cfg_ovrd.load_rules_at_wait = true;
lowermeta
Lower-case meta tag data (legacy)
Lower-case all meta data variable names and values. Replicates behavior in utag.js
versions prior to 4.2x. (Default: false
)
Example meta tag:
<meta content="iQ Tag Management" property="Article:Section">
Resulting value:
utag.data['meta.article:section']="iq tag management"
window.utag_cfg_ovrd.lowermeta = true;
lowerqp
Lower-case query string parameter names and values (legacy)
Lower-case all query string variable names and values. Replicates behavior in utag.js
versions prior to 4.2x. (Default: false
)
Example query string parameter: &RefId=Abc123
Resulting value: utag.data['qp.refid']="abc123"
window.utag_cfg_ovrd.lowerqp = true;
noload
Halt all operations
The execution of all code halts after the extensions scoped to Pre Loader. Extensions scoped to DOM Ready still run. This is normally adjusted using the publish setting for Prevent Tag Load. (Default: 0
)
window.utag_cfg_ovrd.noload = true;
noview
Disable automatic tracking call on initial page load
Suppresses the tracking call that occurs automatically on initial page load. This setting is commonly used on single page application sites. (Default: false
)
window.utag_cfg_ovrd.noview = true;
nocookie
Cookie opt-out
Only set this option if a visitor has explicitly opted out of all cookies. (Default: false
)
Using this option inflates visitor and session counts, making all visits look like “single page sessions”.
This option disables all cookies from being stored by utag.js
, including cookies set with the Persist Data Value extension, and session cookies. It also sets a new timestamp for the variables ut.visitor_id
, tealium_visitor_id
, and cp.utag_main_v_id
when the cookie is not available.
window.utag_cfg_ovrd.nocookie = true
readywait
Delay operations until DOM-ready
Halt all operations until the DOM-ready signal is received from the browser. Extensions scoped to Pre Loader still run when utag.js
loads. (Default: 0
)
window.utag_cfg_ovrd.readywait = true;
secure_cookie
Secure cookie
Set the attribute string to secure
for all utag_main
cookies set by the Persist Data Values extension and the SC()
function. Secure cookies can only be set and accessed on HTTPS pages. (Default: false
)
Requires utag.js
version 4.48
window.utag_cfg_ovrd.secure_cookie = true;
session_timeout
Session timeout
Sets how long to wait, in milliseconds, before expiring the current session. This is normally adjusted using the publish configuration setting for Session Timeout. (Default: 1800000
(30 minutes))
Example to set the timeout to 900000 milliseconds (15 minutes):
window.utag_cfg_ovrd.session_timeout = 900000;
waittimer
Delay tags with timer
Sets how long to wait (in milliseconds) after the DOM Ready event before loading tags. (Default: not set)
window.utag_cfg_ovrd.waittimer = 1000;
This page was last updated: January 7, 2023