Expand my Community achievements bar.

[FEEDBACK REQUESTED] Share your Target user feedback on Gartner Peer Insights by February 29th, 2024!

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.