utag_main cookie

Rookie Contributor

I am trying to consolidate several cookies into utag_main. From what I understand in this article: https://community.tealiumiq.com/t5/iQ-Tag-Management/Tealium-Cookies/ta-p/138 all I have to do is name the cookie as utag_main_mycookie, and the utag.loader.sc and .rc calls should not manage the new cookie within the utag_main cookie. The existing extension code just uses the .SC and .RC calls to write and read the new cookie: var cookie_name = "utag_main_previous_page"; // some cookie var val = utag.loader.RC(cookie_name); // Get cookie //... utag.loader.SC(cookie_name, b[ds]); //Set cookie //... In the browser I see a new cookie being created with the name utag_main_previous_page, in addition to the utag_main cookie. Am I missing something? Thanks, Sriram

Employee Emeritus
Hello Sriram; Question; did you set up the cookie in the Data Layer tab in Tealium IQ as a variable of type cookie, and name it as utag_main_previouspage (following example above)? Then the syntax that should work for setting the cookie or reading should be something like utag.loader.SC("utag_main", {"previouspage": "value;exp-1d"}); hope that helps guide you in the right direction. [this example shows an expiry of one day, but just trying to give you a sketch, your expiry needs might be different) Cheers! -bahman
Rookie Contributor
Thanks Bahman, that was the interface I was looking for. It was mentioned in the article, but didnt realize that the 'parameter' in the example was actually the 'sub-cookie' which was stored in utag_main. Was confused because the cookie creation in the UI is the same for a parameter in utag_main or a new cookie. BTW, if anyone else is looking, to read the parameter, you could use: utag.loader.RC("utag_main").previouspage (in Bahman's example above). Sriram