Hi, I have to track a variable which is in a form of an array, for e.g.,
I have to track hobbies of a person landing up on my site, so as soon as they log in, I want to send that along with other user details, like their name, age etc. Right now, I am doing something like this,
const contextData = { userName: 'ABC', age: 32 }
ACPCore.trackState('Homepage', contextData);
Now, I want to track hobbies too, let's say hobbies for above user are reading, skating, dancing.
So, I am modifying my existing implementation to,
const contextData = { userName: 'ABC', age: 32, hobbies: ['Reading','Skating','Dancing'] }
ACPCore.trackState('Homepage', contextData);
What changes do I need to make in processing rules to map hobbies which is an array to an evar?
Solved! Go to Solution.
Views
Replies
Total Likes
@vivek091195 Adding to Brian's answer , you can asisgn it to a list variable, once the the values are separated by a delimeter, this can be assigned to listVar, where each value is becomes a separate dimensio in reporting
This documentation explains how to configure a listVar
Views
Replies
Total Likes
@vivek091195 - You're probably best converting the array to a delimited string ("Reading,Skating,Dancing") when you add it to the contextData object. Then, in your Processing Rules, you'll just assign the variable to the appropriate eVar/prop.
Views
Replies
Total Likes
@vivek091195 Adding to Brian's answer , you can asisgn it to a list variable, once the the values are separated by a delimeter, this can be assigned to listVar, where each value is becomes a separate dimensio in reporting
This documentation explains how to configure a listVar
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies