[SOLVED] Storing data across two different DTM properties?

Avatar

Avatar

Waqas_Rafiq

Avatar

Waqas_Rafiq

Waqas_Rafiq

10-11-2016

Hi there,

I'm currently working on a new implementation for a client, where they have two different DTM properties in place for the same domain. 

The screen shot underneath here explains the logic. 

I'm assuming that DTM can hold data values across http and https. But after doing some thorough testing, I can see that an issue occurs when you are going from http to https during your session and at the same time the DTM property changes from "http - dtm property A" to "https - dtm property B". My main objective is pretty simple. Store a value when the user enters the website and use it on the confirmation page. In this example i'm storing from a url parameter. I'm defining the data elements with the url listening function found inside data elements. (this part works). 

on http:

I'm then creating a page load rule with a custom javascript that is listening to _satellite.getVar("my unique url paramter"); and if it doesn't exist, nothing happens, but if it does exist, I create a cookie named "refID"  and store the data elemtents value inside that cookie. If I call _satellite.readCookie("refID");  I get the value back. Which is good.. means the logic is working. 

If I then click on to the https area, the following happens:

I'm trying to call _satellite.readCookie("refID"); in the secure area and I get a "undefined" value back. The same thing happens if I store it to localStorage. 

My hypothesis: 

I'm assuming that this is due to the security concern, because i'm changing DTM property and at the same time going from http to https. 

My question:

Is there any way I can solve this through DTM? 

p.s setting the same property across the website is NOT an option at the moment.

Any help/advice on this issue would be appreciated. Thanks. 🙂

 

View Entire Topic

Avatar

Avatar

Waqas_Rafiq

Avatar

Waqas_Rafiq

Waqas_Rafiq

23-07-2018

Hi roshanc44331495​,
As I remember the code was setup inside a page load rule (but it can be in a DCR or Event rule as well).
The value is stored in a cookie that you name yourself, and to get the actual value of the cookie, you can just write "_satellite.readCookie('Name of your cookie')". So inside DTM, in your "data element" you could retrieve the value of the cookie and then use that value across your different tags. In case you don't want the cookie to be stored for longer than after retrieving the value, I would recommend to use a logic where you remove the cookie once the value is read. example:

You set the cookie on "www.siteA.com" (based on my example above) and then when the user goes to "secure.siteA.com" you read the value with the _satellite.readCookie('Name of your cookie'). In your DTM rule, you create an If statement, that looks for the _satellite.readCookie and if it's set, you read the value and delete the cookie at the same time with this request: _satellite.removeCookie('Name of your Cookie')

Hope the above helps, if not, then send me a PM here.

Kind regards,
Waqas