Expand my Community achievements bar.

Join us for an upcoming in-person Adobe Target Skill Builders event ~~> We're hosting these live learning opportunities to equip you with the knowledge and skills to leverage Target successfully. Learn more to see if we'll be coming to a city near you!

user.activeActivities always null in Profile Script?

Avatar

Level 2

Hi I'd like to create a test that isnt expose to visitors qualifying for a specific test earlier in the journey i.e. on homepage.

I tried creating the following Profile Script and using this in my audience but based on debugging/ trace it seems like activeActivities always returns an empty array in the profile script.

if(!user.get('not_in_homepage_activity')){
if(user.activeActivities.indexOf(123456) == -1){
   return 'true';
}
}

How can i resolve this?

 



 

3 Replies

Avatar

Employee

Hi, @richardlee it's about the hard typing at the user attributes, in that case you'll need to convert the user.activeActivities array to a string by adding .join right after it:

 

if(!user.get('not_in_homepage_activity')){
  if(user.activeActivities.join.indexOf('123456') == -1){
     return 'true';
  }
}

 

Avatar

Level 1

I encountered this issue. The answer is that any combination of get, profile, user, activeActivities,  whatever will crash the profile script. It will not process anything past the point you introduce it.

 

What does work:
user.activeCampaigns
What is it?
An array of integers referring to active target activities.