Data elements in SPA when next page JSON is undefined
We are running into issues where a JSON is undefined in a subsequent page by design.
Suppose a data layer in an SPA:
Page 1: digitalData.abc returns "label X"
Page 2: digitalData.abc returns undefined
The data element (DE) that maps to it would:
Page 1: DE returns "label X" !
Page 2: DE returns "label X"
What's the best way, if it's possible, to make the DE return undefined in page 2?
I tried converting the DE to custom code (below). Doesn't work.
if(digitalData.abc == undefined){
return undefined;
}
else {
return digitalData.abc;
}
Any advice?
