Extension help pulling value out of the omniture s_sess cookie value. I am trying to pull the s_vid value out of the s_sess cookie Omniture sets. I tried using a set variable extension using javascript with the following s_2.c_r('s_vid')

joseph_brown
Silver Contributor
Silver Contributor joseph_brown
We currently have the following in our s_code that I am trying to replicate into an extension within Tealium if(s.c_r('s_vid') != ''){ s.eVar16=s.prop16=s.visitorID=s_2.c_r('s_vid')}
7 REPLIES 7

Extension help pulling value out of the omniture s_sess cookie value. I am trying to pull the s_vid value out of the s_sess cookie Omniture sets. I tried using a set variable extension using javascript with the following s_2.c_r('s_vid')

Tealium Employee
Omniture creates their cookie "server-side" which means that you won't have this available until after the tracking request has already occurred (for your first page view of the visit.) So you will only see data in the cookie on your second and subsequent page views in the visit. (You need to have a first party tracking server with Omniture so it will set this cookie in the 1st party domain.)

Extension help pulling value out of the omniture s_sess cookie value. I am trying to pull the s_vid value out of the s_sess cookie Omniture sets. I tried using a set variable extension using javascript with the following s_2.c_r('s_vid')

joseph_brown
Silver Contributor
Silver Contributor joseph_brown
So we are setting our cookies through a 1st party stats.lfg.com and sstats.lfg.com.

Extension help pulling value out of the omniture s_sess cookie value. I am trying to pull the s_vid value out of the s_sess cookie Omniture sets. I tried using a set variable extension using javascript with the following s_2.c_r('s_vid')

reid_linker
Not applicable
reid_linker
The c_r() function of SiteCatalyst Object is usually a "cookie read" helper function (hence "c_r"). I'm still a little new to Tealium myself, but off the top of my head, you could create a Data Source named "s_vid" with type of "Cookie Value", a Load Rule testing for the new "s_vid" Datasource being empty ("is populated"), create a Custom Container tag set to the Load Rule, and use the JavaScript Code extension with something like "s.eVar16=s.prop16=s.visitorID=b.s_vid;" scoped to the Custom Container tag. Note: You may need to check for the "s" object's existence before trying to set it, ie- "if(!!window.s)s.eVar16=s.prop16=s.visitorID=b.s_vid;"

Extension help pulling value out of the omniture s_sess cookie value. I am trying to pull the s_vid value out of the s_sess cookie Omniture sets. I tried using a set variable extension using javascript with the following s_2.c_r('s_vid')

Tealium Employee
Great. Just remember, you can't read this cookie on the first page view event. The cookie isn't set yet. (The cookie is created server-side and comes back from Omniture after the first tracking request.) Create a new item in the Data Sources tab called "s_vi" (Cookie Type) and Tealium will read this automatically when it is set. Then you can map "s_vi (cp)" to any data point.

Extension help pulling value out of the omniture s_sess cookie value. I am trying to pull the s_vid value out of the s_sess cookie Omniture sets. I tried using a set variable extension using javascript with the following s_2.c_r('s_vid')

Tealium Employee
The same *concept* applies to the "s_sess" cookie. It doesn't have the v_sid value in there until the second page view of the visit.

Extension help pulling value out of the omniture s_sess cookie value. I am trying to pull the s_vid value out of the s_sess cookie Omniture sets. I tried using a set variable extension using javascript with the following s_2.c_r('s_vid')

joseph_brown
Silver Contributor
Silver Contributor joseph_brown
Thanks for all the help. All I really needed to do was update my SiteCatalyst "Function - read combined cookies plugin" and I was able to simply use s.c_r('s_vid'). However one of our engineers Allan whipped up some jQuery which handles it as well. Simply change the alert to a variable of your choosing. $(s.c_r('s_sess').split("; ")).each(function(k, v) { if (v.substring(0, 5) === "s_vid") {alert(v.split("=")[1]); } });
Highlighted

Extension help pulling value out of the omniture s_sess cookie value. I am trying to pull the s_vid value out of the s_sess cookie Omniture sets. I tried using a set variable extension using javascript with the following s_2.c_r('s_vid')

joseph_brown
Silver Contributor
Silver Contributor joseph_brown
Thanks for the info. I like the idea of leveraging load rules to test for the value before running any code and will have to play with that a little bit.