Visitor profile - is it possible to have array of values ? | Community
Skip to main content
Michael_Soprano
Level 10
November 3, 2025
Question

Visitor profile - is it possible to have array of values ?

  • November 3, 2025
  • 2 replies
  • 179 views

I am working with only AT and Web SDK. So I need to write user categories into user profile (my customer does not have AA)

Depending on the URL path I would like to update visitor profile with values:

if /finance 

profile.interests = 'finance'

 

if '/real-estate' 

profile.interests = 'real estate'

 

How to do that in order to have on the profile array of values?

Like

profile.interests = [finance, real estate, banking .....]

Any ideas?

2 replies

Michael_Soprano
Level 10
November 6, 2025

Is it possible?

Gokul_Agiwal
Community Advisor
Community Advisor
November 8, 2025

Hi @michael_soprano  

As far as I know, Adobe target allows only single string values in profile attribute and array format not supported. 

sriharshanaladala98
Level 2
November 12, 2025

Hi @michael_soprano ,

By default, Adobe Target’s profile attributes are key-value pairs, not arrays.
But  you can simulate an array by appending to the same attribute with different values across visits.

Each time the user visits a new section, append the value to the existing string

const path = window.location.pathname;
let newInterest = null;

if (path.includes("/finance")) newInterest = "finance";
else if (path.includes("/real-estate")) newInterest = "real estate";
else if (path.includes("/banking")) newInterest = "banking";

if (newInterest) {
// Get previously stored interests (if any)
let interests = localStorage.getItem("user_interests")?.split(",") || [];
if (!interests.includes(newInterest)) {
interests.push(newInterest);
localStorage.setItem("user_interests", interests.join(","));
}

// Send to Target
alloy("sendEvent", {
xdm: {
profile: {
interests: interests.join(",")
}
}
});
}