9 Replies Latest reply on May 7, 2018 5:24 PM by aaronc10

    Data elements in SPA when next page JSON is undefined

    aaronc10 Level 1

      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?