Tealium cookies
This article explains how cookies from the Universal Tag (utag.js) work and how to work with your own cookies within Tealium iQ Tag Management.
How it works
The Tealium Universal Tag (utag.js
) creates and maintains first-party cookies in most cases.
In utag version 4.50 or later, when the split_cookie
setting is enabled (default), the utag.js
script creates and manages standalone cookies within the utag_
namespace.
In earlier versions of utag, or when the split_cookie
utag setting is false
, the utag.js
script creates and maintains a single utag_main
cookie with several delimited key/value pairs that keep track of the visitor session.
The cookie variables in the data layer are the same, regardless of that setting. These variables can be easily added to your data layer using the Tealium Built-In Data Bundle.
The split_cookie_allowlist
setting can be used to limit which cookies are allowed to be set, but only when split_cookie
is active.
The split_cookie
and split_cookie_allowlist
settings require utag.js
version 4.50 and later.
Built-in cookies
The built-in cookie variables are:
Cookie Variable | Description |
---|---|
tag_main_ses_id |
The Unix/Epoch timestamp of the session start, in milliseconds. |
utag_main__st |
The Unix/Epoch timestamp of the session timeout, in milliseconds - updated on new events. |
tag_main_v_id |
A unique, partially random identifier. In utag version 4.50 and later, not set by default. - the Collect tag writes this cookie when needed. |
tag_main__ss |
A Boolean that indicates if the page viewed is the first in a session. A value of 1 means yes and 0 means no. |
utag_main__pn |
The number of pages viewed during the current session. |
utag_main__sn |
The number of sessions for this visitor. |
Since utag 4.50, the v_id
component of utag_main
is no longer set by default in utag, but inside the Tealium Collect tag to ensure that it’s never set without a clear purpose. To override this behavior and generate this cookie for all visitors, enable the utag setting always_set_v_id
.
Starting with version 4.50, utag_main_v_id
is no longer generated in utag by default. Responsibility for that ID has been moved to the Tealium Collect tag (the only place it’s used), to ensure that it’s never set without a clear purpose. To override this behavior and generate this cookie for all visitors, use the utag setting always_set_v_id
. For information about how to update and ensure you’re using the latest utag, see Managing Templates.
You can reference custom utag_main
cookies by creating a new variable of type First Party Cookie with the prefix utag_main_
(for example, utag_main_mycookie
). This keeps cookies associated with your Tealium installation separated from the global cookie namespace, which helps to avoid name collisions and makes it clear which cookies come from your tag manager.

Cookie functions
Tealium iQ exposes two cookie functions which provide an easy interface to set and read custom cookies, with governance, from anywhere. For more information, see Cookie Functions.
Customers can use the split_cookie_allowlist
setting to limit which cookies are set. This setting ensures that tags and custom functionalities don’t set undeclared cookies. It also prevents utag.loader.SC from writing disallowed cookies.
Cookies from extensions
The Persist Data Value, Split Segmentation, and Privacy Manager extensions create and leverage cookies when used.
Cookies from tags
Some tags create and leverage cookies when used to persist identifiers or other information, using Tealium’s Cookie Functions.
Cookies from tag scripts
Some tags generate cookies that store identifiers or other data using third-party scripts to create cookies right after the tag is triggered. This process doesn’t involve any Tealium functionality to write the cookie.
These cookies are not controlled by Tealium iQ, and are not limited by the split_cookie_allowlist
setting, or any other built-in Tag Management functionality.
Persist Data Value (cookie)
The Persist Data Value extension allows you to create a cookie in which you can persist the value of a variable. To persist the value for a variable, you can create a new cookie or use an existing cookie. You may persist the value for a variable in the utag_main cookie by prefixing utag_main_
to the name of the cookie variable, for example: utag_main_mycookievar
.
Split Segmentation
The purpose of the Split Segmentation extension is to divide visitors into segments you specify. The extension stores the segment data in the cookie variable you create.
If this extension is scoped to Preloader, you must use a cookie other than utag_main
.
Privacy Manager
The Privacy Manager extension uses a cookie named OPTOUTMULTI
to save the privacy settings for a visitor for the next time they visit your site. The settings you select in Privacy Manager are saved as parameters in the cookie.
Cookies from Consent Manager
The Consent Manager uses a cookie named CONSENTMGR
to save the consent settings of a visitor.
Learn more about consent management.
To change the name of the CONSENTMGR
cookie, first verify that you are using version 2.0.1 or later of the cmGeneral template, then use a Javascript Code extension scoped to All Tags - Before Load Rules with the following code:
utag.gdpr.cookieNS = 'NEW_COOKIE_NAME';
To change the retention period of the consent cookie, use the configuration override setting for utag.js
.
Cookies from Web Companion
Web Companion uses a cookie to save the publish environment (Prod, QA, Dev, or Custom) you were viewing when you last visited your site. Viewing the default publish environment for your site does not set a cookie.
The last viewed publish environment is saved in the following cookie, where {account}
and {profile}
are replaced with your account and profile:
utag_env_{account}_{profile}
If you clear your browser’s cookies, Web Companion does not save which publish environment you were viewing, requiring you to re-select the environment to view.
This page was last updated: September 20, 2023