For my application, I want to capture an array of values. I have set up a listVar in Adobe Analytics with a delimiter of ',' and from my application I am storing the list(options) in local storage like this- option1,option2,option3. I have made a rule corresponding to it in Adobe Experience Launch, and setting variable using Custom Code-
s.list1 = localStorage.options;
But when I pull up list1 listVar in Analytics Dashboard, I am getting Unspecified. Please tell me where I am going wrong here.
Solved! Go to Solution.
Views
Replies
Total Likes
That certainly tells you how often I work with localStorage in Launch
If you're still having this issue, I'd suggest the following options:
Views
Replies
Total Likes
@vivek091195 First you need to check whether localStorage.options is returning values or not. If it is returning values than check what kind of values it is returning. Whether it is giving a single value or all values.
Views
Replies
Total Likes
@vivek091195 - Assuming you've set the localStorage key correctly, you'll need to call localStorage.getItem("options") to retrieve it. For example:
localStorage.setItem("options", "one,two,three"); // sets the "options" storage key to "one,two,three" localStorage.getItem("options"); // retrieves "one,two,three" from the "options" storage key
Views
Replies
Total Likes
@Brian_Johnson_ Thanks for the reply. We can access localStorage items directly using the dot operator. It works exactly like localStoarge.getItem()
That certainly tells you how often I work with localStorage in Launch
If you're still having this issue, I'd suggest the following options:
Views
Replies
Total Likes