Config Overrides for utag.js

Config Overrides for utag.js

by cherr_batac on ‎05-17-2016 09:51 AM - edited on ‎11-26-2018 03:31 AM by (10,344 Views)

This article explains the available configuration overrides that can be set to adjust the behavior of utag.js.

Table of Contents Placeholder

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 can be overridden using a new object called utag_cfg_ovrd. This object can be set in your page code prior to loading utag.js or within a JavaScript Code Extension scoped to Pre Loader. The override object should be scoped to the window object and initialized safely with the following convention:

window.utag_cfg_ovrd = window.utag_cfg_ovrd || {};

Config Options

dom_complete - Delay Tags Until DOM Complete (load) Event

Fires tags at the document load event rather than at DOM Ready.  This will also hold back any extensions scoped to DOM Ready.  

Configuration Parameter: dom_complete

Default value: false

Example: 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 (e.g.

Configuration Parameter: domain

Default value: The top-level domain of location.hostname

Example: window.utag_cfg_ovrd.domain = "";

load_rules_ajax - Disable Load Rules After Page Load (legacy)

Controls if Load Rules will be reprocessed on each call to utag.view and within the same page load. A newly triggered Load Rule could load a new tag into the page. Use this setting to replicate behavior from versions of utag.js older than 4.2x.

Configuration Parameter: load_rules_ajax

Default value: true

Example: 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 can make use of extension execution order instead of this setting.

Configuration Parameter: load_rules_at_wait

Default value: false

Example: window.utag_cfg_ovrd.load_rules_at_wait = true;

lowermeta - Lower-case Meta Tag Data (legacy)

Lower-case all meta data variables and values (eg.['']). Replicates behavior in utag.js versions prior to 4.2x.

Configuration Parameter: lowermeta

Default value: false

Example: window.utag_cfg_ovrd.lowermeta = true;

lowerqp - Lower-case Query String Parameters and Values (legacy)

Lower-case all query string variables and values (eg.['qp.refid']). Replicates behavior in utag.js versions prior to 4.2x.

Configuration Parameter: lowerqp

Default value: false

Example: window.utag_cfg_ovrd.lowerqp = true;

noload - Disable utag.js

Suppresses the loading of all tags. The execution of utag.js will halt after Pre Loader extensions. Extensions scoped to DOM Ready will still run. This is normally adjusted using the Publish Configuration setting for Prevent Tag Load.

Configuration Parameter: noload

Default value: 0

Example: window.utag_cfg_ovrd.noload = true;

noview - Disable Initial Tracking (Single Page Applications)

Suppresses the automatic page tracking event called by utag.js. Commonly used on single page application sites.

Configuration Parameter: noview

Default value: false

Example: window.utag_cfg_ovrd.noview = true;

nocookie - Cookie Opt-Out

Only set this option if/when a user visiting your site has explicitly opted out of all cookies.

This option will:

  • disable all cookies from being stored by utag.js, including cookies set with the Persist Data Value Extension, and visitor/session cookies.
  • set a new timestamp for the variables ut.visitor_id, tealium_visitor_id, and cp.utag_main_v_id when the cookie is not available.

    CAUTION: Using this option inflates visitor and session counts, making all visits look like "single page sessions".

Configuration Parameter: nocookie

Default value: false


readywait - Delay utag.js Until DOM Ready

Halt all utag.js operations until the DOM-Ready signal is received from the browser. Extensions scoped to Pre Loader still run when utag.js loads.

Configuration Parameter: readywait

Default value: 0

Examplewindow.utag_cfg_ovrd.readywait = 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.

Configuration Parameter: session_timeout

Default value: 1800000 (30 minutes)

Examplewindow.utag_cfg_ovrd.session_timeout = 900000; (sets timeout to 900000 milliseconds, or 15 minutes)

waittimer - Delay Tags with Timer

Sets how long to wait (in milliseconds) after the DOM Ready event before loading tags.

Configuration Parameter: waittimer

Default value: (not set)

Examplewindow.utag_cfg_ovrd.waittimer = 1000; (wait 1000 milliseconds, or 1 second)

consentPeriod - Consent Manager retention period

Overrides the default 90 days with a custom number of days.

Configuration Parameter: consentPeriod

Default value: (not set, but resolves to 90)

Examplewindow.utag_cfg_ovrd.consentPeriod = 60; (Sets the consent manager cookie to expire in 60days)


gdprDLRef - Consent Manager Language Preference Override

Allows for overriding the browser-based language detection to using a value that is in the data layer.

Configuration Parameter: gdprDLRef

Default value: (not set, but resolves to language from the browser)


window.utag_cfg_ovrd.gdprDLRef = "page_language";

var utag_data = {
    "page_language" : "es"

When the call to get language happens, we will use the data layer value as the point of reference, when rendering each of the modals.
In the above example, the modals will try and render using Spanish, falling back to the default if not present in the configuration.