How can I capture an array of values in Adobe Analytics? | Community
Skip to main content
Level 2
Sep 22, 2021 4:22 PM UTC
Solved

How can I capture an array of values in Adobe Analytics?

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Brian_Johnson_
Brian_Johnson_Accepted solution
Level 8
Sep 24, 2021 12:51 PM UTC

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:

  1. Confirm that the value is actually set in localStorage. You can do this by running the localStorage.getItem("options"); command in the console or checking the storage key directly in your browser's developer tools.
  2. Confirm that the data element is actually getting set by calling _satellite.getVar("YOUR-DATA-ELEMENT-NAME"); directly in the console.
  3. Confirm that the value is included on the analytics calls by evaluating the network request directly, or through any of a number of debugging tools (AEP Debugger, ObservePoint plugin, etc).

 

4 replies

Brian_Johnson_
Level 8
Sep 22, 2021 10:28 PM UTC

@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
Translate
Level 2
Sep 23, 2021 5:04 AM UTC

@brian_johnson_ Thanks for the reply. We can access localStorage items directly using the dot operator. It works exactly like localStoarge.getItem()

Translate
Brian_Johnson_
Brian_Johnson_Accepted solution
Level 8
Sep 24, 2021 12:51 PM UTC

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:

  1. Confirm that the value is actually set in localStorage. You can do this by running the localStorage.getItem("options"); command in the console or checking the storage key directly in your browser's developer tools.
  2. Confirm that the data element is actually getting set by calling _satellite.getVar("YOUR-DATA-ELEMENT-NAME"); directly in the console.
  3. Confirm that the value is included on the analytics calls by evaluating the network request directly, or through any of a number of debugging tools (AEP Debugger, ObservePoint plugin, etc).

 

Translate
Level 7
Sep 22, 2021 7:27 PM UTC

@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.

Translate