Highlighted

Does Tealium provide access to a server-side, GMT timestamp?

Silver Contributor
Silver Contributor
Some tag vendors want a visit or session-start timestamp. Since JS times are OS dependent, and inconsistent at best and unreliable at worst, is there a way Tealium clients can access a time value from Tealium servers, format that ourselves, and provide to a vendor? GMT/UTC would be fine. :-D
8 REPLIES 8
Highlighted

Does Tealium provide access to a server-side, GMT timestamp?

Tealium Employee
I agree that client-side timestamps are not 100% accurate, but you can usually use this (convert to GMT) and this is good enough for most tag vendors to work with. The Tealium utag_main cookie has a timestamp for the "start of the session" built in. (latest utag.js required) Another solution is to add a timestamp from your web server to the "utag_data" object. Add this as a data layer element when you generate your utag_data object in the HTML source. There are Tag Vendors out there that you can use to get this type of information. I've seen this one mentioned: http://www.visitorjs.com/details/api/setup I'm not recommending this vendor, only showing them as an example.
Highlighted

Does Tealium provide access to a server-side, GMT timestamp?

Silver Contributor
Silver Contributor
Thanks; I've always read that clientside timestamps ought to be avoided due to inaccurate clocks, but, haven't been able to find real world incidence of how many are not correct. A utag.timestamp value returned on every page load would be great though .
Highlighted

Does Tealium provide access to a server-side, GMT timestamp?

Tealium Employee
John, thanks for your feedback. This is noted. Right now, the preferred solution is adding this to the data layer. The data layer timestamps would then also match your web server log timestamps if there is ever a need for data integration. var utag_data = { page_name : "home", page_type : "content", current_date : "20140605", current_time : "14:00:00" } The client-side session start timestamp is available in the built-in data layer as "cookie" data type called "utag_main_ses_id". b["cp.utag_main_ses_id"] ==> a Session ID value in utag_main cookie -- this is a timestamp that can be used to compute a visitor's time on site
Highlighted

Does Tealium provide access to a server-side, GMT timestamp?

Employee Emeritus
Hey John, Let me know if you want to talk about this in more detail at our next meeting. Thank you!
Highlighted

Does Tealium provide access to a server-side, GMT timestamp?

Bronze Contributor
Bronze Contributor
Hi Ty, I am having the same problem, but a utag_data solution would require a dev cycle. Due to EOY time constraints I will (for now anyway) have to leverage the user-side start of session. I think I follow your suggestion, but I would appreciate a validation of my understanding. -In the data layer, create a first party cookie, called utag_main_event_date -associate my utag_main_event_date to my Webtrends tag -Create a JS Extension. The extension should call the ses_id parameter. Convert the ses_id to GMT and add 8 (we are PST). Thanks for the help!
Highlighted

Does Tealium provide access to a server-side, GMT timestamp?

Tealium Employee
The client-side session start timestamp is available in the built-in data layer as "cookie" data type called "utag_main_ses_id" You could create another variable event_date (UDO type) // JS Extension to add current time (in a string format) to data layer b.event_date = (new Date(parseInt(utag.data["cp.utag_main_ses_id"]))).toString()
Highlighted

Does Tealium provide access to a server-side, GMT timestamp?

Bronze Contributor
Bronze Contributor
Thanks for responding, but I am not sure I follow. Other than it sounds like my approach is wrong.
Highlighted

Does Tealium provide access to a server-side, GMT timestamp?

Tealium Employee
Your approach seems right with respect to creating a new data point and then mapping this value in your tag. The code below (in a JS Extension) is to create the new data point called "event_date". If you want GMT. Use "toUTCString()" instead. b.event_date = (new Date(parseInt(utag.data["cp.utag_main_ses_id"]))).toUTCString()