@aepaa
Ohkk that's real weird.
Let me try and replicate similar setup tomorrow and check.
Hey@jennifer_dungan Any thoughts on what else might be going on here ?
Ah, yep.. having cookies set to the main domain and to the subdomain is going to cause some issues...
Both sites are using the same Launch property?
However, both
https://example.com
and
https://xyz.example.com
should use 2 domain periods in the settings, which should set cookies to ".example.com"....

But I am not sure about if the plugin uses those settings (it should... but its hard to say)
I dug into the code of the plugin a bit, and I think the problem is this piece:
h=window.location.hostname

h is the host that the cookie is written to, and "window.location.hostname" returns the full hostname, not the "main domain"....
Most of these plugins were written a long time ago, mostly for simpler times without the use of a lot of subdomains....
I think to make this work, you might need to make some minor changes to the code... here is a suggestion, but please test this thoroughly before using:
/* Adobe Consulting Plugin: getPreviousValue v3.0 */
function getPreviousValue(v,c){var k=v,d=c;if("-v"===k)return{plugin:"getPreviousValue",version:"3.0"};var a=function(){if("undefined"!==typeof window.s_c_il)for(var c=0,b;c<window.s_c_il.length;c++)if(b=window.s_c_il[c],b._c&&"s_c"===b._c)return b}();"undefined"!==typeof a&&(a.contextData.getPreviousValue="3.0");window.cookieWrite=window.cookieWrite||function(c,b,f){if("string"===typeof c){var h=getMainDomain(window.location.hostname),a=getMainDomain(window.location.hostname).split(".").length-1;if(h&&!/^[0-9.]+$/.test(h)){a=2<a?a:2;var e=h.lastIndexOf(".");if(0<=e){for(;0<=e&&1<a;)e=h.lastIndexOf(".",e-1),a--;e=0<e?h.substring(e):h}}g=e;b="undefined"!==typeof b?""+b:"";if(f||""===b)if(""===b&&(f=-60),"number"===typeof f){var d=new Date;d.setTime(d.getTime()+6E4*f)}else d=f;return c&&(document.cookie=encodeURIComponent(c)+"="+encodeURIComponent(b)+"; path=/;"+(f?" expires="+d.toUTCString()+";":"")+(g?" domain="+g+";":""),"undefined"!==typeof cookieRead)?cookieRead(c)===b:!1}};window.cookieRead=window.cookieRead||function(c){if("string"===typeof c)c=encodeURIComponent(c);else return"";var b=" "+document.cookie,a=b.indexOf(" "+c+"="),d=0>a?a:b.indexOf(";",a);return(c=0>a?"":decodeURIComponent(b.substring(a+2+c.length,0>d?b.length:d)))?c:""};var l;d=d||"s_gpv";a=new Date;a.setTime(a.getTime()+18E5);window.cookieRead(d)&&(l=window.cookieRead(d));k?window.cookieWrite(d,k,a):window.cookieWrite(d,l,a);return l};
/******************************************** END CODE TO DEPLOY ********************************************/
function getMainDomain(host){
mainDomain = host.match(/[^\.]*\.[^.]*$/)[0];
return mainDomain;
}
Basically I modified the "h" and "a" values in the plugin:
var h=getMainDomain(window.location.hostname),a=getMainDomain(window.location.hostname).split(".").length-1;
And added a function to process the host values to return the main part of the domain.....
I can test my function, but I can't test the whole plugin....