How to control the popup Count based on the session in Adobe Target? | Community
Skip to main content
Level 2
September 2, 2025
Question

How to control the popup Count based on the session in Adobe Target?

  • September 2, 2025
  • 1 reply
  • 574 views

I am showing the pop-up on Experience Targeting activity. I want to show this popup one time in a session, so I have used the below profile script as user_freq,

if(user.sessionId!=user.getLocal('lastSessionId')){
user.setLocal('lastSessionId', user.sessionId);
   return (profile.get('visitCount') || 0) + 1; // changend line
}

Then use this scripts in audience attributes, the condition is user_freq < 2. But its not working properly, the popup showing again and again in a same session. 

 

1 reply

Gokul_Agiwal
Community Advisor
Community Advisor
September 2, 2025

Hi @jayasekar  In this case, the profile script alone won't work. You need to handle the logic for pop up to shown once. this you can do either setting up the flag for popup in session or in a cookie.

jayasekarAuthor
Level 2
September 2, 2025

Hi @gokul_agiwal 

Thank you for the reply!

Is it possible to control the popup shown using the profile script?

Gokul_Agiwal
Community Advisor
Community Advisor
September 2, 2025

HI @jayasekar   Yes its possible but it completely depends on your use case. 

For ex.

IF you're showing popup experience on page load once per session then it works however if you're showing this in middle of the journey then may not be good fit. 

Also if this you're trying with SPA  then profile script alone won't work here. You need to use logic at client side with Target param ..  

 

So could you please elaborate your use case and how your Target has been setup?