I am trying to create an audience in my Adobe Target that meets the condition of impacting the user a limited number of times. To do this, I have created the following rule:
This rule is based on a profile script named profilescript_countVisitNumber that I have created:
var x = mbox.name;
var count_x = user.get('profilescript_countVisitNumber') || 0;
if(x !== 'undefined') {
return count_x + 1;
}
The idea to achieve is that each time the user sees the Activity, count_x will increment the value by 1. When the user has viewed the activity more than 3 times (the rule I created) it should no longer be displayed.
I can't get the JS profile script code to count the number of times the user views the activity.