Suggestions on the best/ideal way to funnel a visitor ID that can come from multiple sources into one?

Gold Contributor
Gold Contributor
When a user logs into some of our sites I set a unique ID, a nonPII GUID, into a data source page.wid. I also take this data source and persist it in a cookie value wid, so that if and when a person returns and does not log in to our site or tries to log in and fails, I can still see who the individuals are. I also look for and grab the Omniture visitorID this is because we have some users still on our older systems that do not have the nonPII GUID available. This extension is scoped to just SiteCatalyst because I call the read cookie function s.c_r('s_vid'). I would like to get these values into a single data source but in rank order. 1) if page.wid is available that should trump all other settings. 2) If page.wid is not available it should fall to using the cookie value wid. 3) If page.wid and cookie wid is not available it should look to use the Omniture VisitorID. It gets a bit tricky when I look to use the omniture VisitorID because s.c_r('s_vid') will only work when scoped to sitecatalyst as I have to wait for the site catalyst code to load before calling it. However I want to be able to share this across other tags that are in use. Suggestions/Ideas appreciated.
1 REPLY 1

Suggestions on the best/ideal way to funnel a visitor ID that can come from multiple sources into one?

Tealium Employee
Hi Joe, TealiumIQ has its own method of reading all 1st party cookies on a site. Given the stated requirements we should be able to perform this logic for you with the extensions scoped to All Tags. As long as the utag_data object is declared about the utag.js script call, we are in business. In the Data Sources tab: - declare "page.wid" as type "Data Object" - declare "wid" as type "Cookie" - declare "s_vid" as type Cookie - declare a new variable such as "visitorId" as type "Data Object" Create 3 Set Data Values extensions scoped to "All Tags" with the following logic for each: 1) Set "visitorID" to "Variable" of "cp.s_vid" with condition "cp.s_vid" "is defined" 2) Set "visitorID" to "Variable" of "cp.wid" with condition "cp.wid" "is defined" 3) Set "visitorID" to "Variable" of "page.wid" with condition "page.wid" "is defined" This will perform with last-in logic where s_vid is set first and overwritten if cookie wid exists, which could then be overwritten if page.wid exists. Please let me know if this would suffice. If there are other extenuating items you could always use a JS extension with the following: if(b["page.wid"]){ b.vistorId=b["page.wid"]; }else if(b["cp.wid"]){ b.vistorId=b["cp.wid"]; }else if(b["cp.s_vid"]){ b.vistorId=b["cp.s_vid"]; } Cheers, -Dan
Public