Setting cookie to Tracking server based on domain

Silver Contributor
Silver Contributor
Hi All, We have two sites with xyz.com and xyz.ca domain and tracking server is defined only for .com domain so visitors are not getting tracked for .ca domain. Is there a way to customise the s_code based on domain to set cookie for relevant tracking server e.g. if(document.url.indexOf('.ca')trackingserver = xyz.com else trackingserver = xyz.ca OR Any other way to define trackingServer for .ca domain using same scode that has trackingServer defined as .com
4 REPLIES 4

Setting cookie to Tracking server based on domain

Tealium Employee
Hi Vicky, What you can do is create a set data values extension that sets the value of the server and then map this to the tag. That way it will set correctly for when the tag fires. Regards, Adrian
Ask me anything Tealium related or TypeScript/JavaScript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.

Setting cookie to Tracking server based on domain

Silver Contributor
Silver Contributor
Thanks for the reply Adrian, So i can create a set data values extension with tracking server js variable = js code wherein i could create a code show below Set: TrackingServer to:JSCode if(document.baseURI.indexOf('.com')>-1) return .com if(document.baseURI.indexOf('.ca')>-1) return .ca If above data values sets right, do i need to remove the default server value from the sc tags section in tealium

Setting cookie to Tracking server based on domain

Silver Contributor
Silver Contributor
Hi Adrian, Please find below has more updates on this issue: URL 1- http://coupons2.smartsource.com/smartsource2/static_content/app/#/index.html?linkId=6EB7MSDFQMT4C&pr 1. The cookie s_vi is setting up for smartsource.com under â Domainâ which is correct but for the URL 2. URL 2: http://www.smartsource.ca/smartsource2/static_content/app/#/index.html?linkId=SEF65DL3D63V4&printId= 1. The cookie s_vi is setting up for smartsource.com under â Domainâ for the above URL 2, meaning cookie is set for smartsource.com even though the URL is smartsource.ca 2. Ideally, the cookie value in â Domainâ should set for smartsource.ca. In our case it is not setting up to .ca domain. 3. All other cookies (s_cc, s_fid, s_sq) has been set to the â Domainâ smartsource.ca expect for s_vi and it has been set to smartsource.com. Note: Is it possible to attach screenshots of these issue here ? If yes, please let me know the procedure. Thanks, Vicky

Setting cookie to Tracking server based on domain

Tealium Employee
Hi Vicky, I think this would be easier to resolve if you would like to do a Go-To-Meeting. If you would like to drop me an email at adrian@tealium.com we can set a meeting up and I cam talk you through this. Regards, Adrian
Ask me anything Tealium related or TypeScript/JavaScript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.
Public