내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

Profil script - Counter mbox views

Avatar

Level 1

Hi everyone,

 

I want to configure a profil script who is going to count the number of time that the mbox was viewed by a visitor.

 

After two times that my mbox was viewed by the user, the visitor is no more able to see the activity.

 

Ex : I have an activity that I want only to show to the user two times.

 

name of the mbox = home

 

it's possible to do that by a profil script ? 

activity name = Security Ad

 

주제

토픽은 커뮤니티 콘텐츠를 분류하여 관련성 있는 콘텐츠를 찾는 데 도움이 됩니다.

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Community Advisor

@A2896 this would be simple, setup a profile script with a name as per your preference and add this code and replace xyz as per mbox id and <<profile-script-name>> placeholder with profile script name. Create audience with visitor profile attributes nd select the profile script name you just created with evaluator as <= with static value comparison as 2. Finally use this audience as eligibility criteria.

 

if (mbox.name == 'xyz') {
        return (user.get(<<profile-script-name>>) || 0) + 1;
    }
}

 

#sample screenshot

 

nnakirikanti_0-1683175824124.png

 

 

원본 게시물의 솔루션 보기

2 답변 개

Avatar

정확한 답변 작성자:
Community Advisor

@A2896 this would be simple, setup a profile script with a name as per your preference and add this code and replace xyz as per mbox id and <<profile-script-name>> placeholder with profile script name. Create audience with visitor profile attributes nd select the profile script name you just created with evaluator as <= with static value comparison as 2. Finally use this audience as eligibility criteria.

 

if (mbox.name == 'xyz') {
        return (user.get(<<profile-script-name>>) || 0) + 1;
    }
}

 

#sample screenshot

 

nnakirikanti_0-1683175824124.png

 

 

Avatar

Level 1

@nnakirikanti  Many thanks for your answer, I'm going to try your solution.  Thanks