exit pop up AB Test | Community
Skip to main content
Level 2
May 14, 2021
Solved

exit pop up AB Test

  • May 14, 2021
  • 2 replies
  • 2571 views

Hi, I am using this template to setup a pop up at the time of user exit: https://github.com/Adobe-Marketing-Cloud/target-experience-templates/tree/master/lightbox-exit-inten.... It works great except I am not able to limit it once per session. Currently it shows on all pages when i hover over close button. I am ok limiting this once per visitor level too or even cookie. Is there a way to do that in target? I know there is one way where you can chose your reporting source as "Adobe Target" and you could go into the Advanced settings in the success metric and choose the option that increments the count and then bars from re-entry and set a  user to convert right away, like on user seeing **any mbox**. However I want to use A4T so I can do my reporting in analytics.

 

Please let me know if anyone has found a way to do this!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Gaurav_Singh_02

@nsingh11  you may try using profile script to restrict user on bases of sessionId , count of visit or whether visitor is already part of the  . Few sample codes can be found here : https://experienceleague.adobe.com/docs/target/using/audiences/visitor-profiles/profile-parameters.html .

 

For example :

 

1.if you want to restrict the experience to specific URL then you may try this : 

 

if (page.url.indexOf('urlToMatch') > -1) {
return 1;
}else{
if (!user.get('nameOfScript')) {
return 0;
}
}

 

2.profile script to restrict user on bases of sessionId :

 

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

 

You can also leverage Target goal conversion Advance settings and select "Increment Count, Release User & Bar from Reentry" . For more details you may refer to this document : https://experienceleague.adobe.com/docs/target/using/activities/experience-targeting/create-targeting/xt-goals-and-settings.html 

2 replies

Gaurav_Singh_02Adobe EmployeeAccepted solution
Adobe Employee
May 17, 2021

@nsingh11  you may try using profile script to restrict user on bases of sessionId , count of visit or whether visitor is already part of the  . Few sample codes can be found here : https://experienceleague.adobe.com/docs/target/using/audiences/visitor-profiles/profile-parameters.html .

 

For example :

 

1.if you want to restrict the experience to specific URL then you may try this : 

 

if (page.url.indexOf('urlToMatch') > -1) {
return 1;
}else{
if (!user.get('nameOfScript')) {
return 0;
}
}

 

2.profile script to restrict user on bases of sessionId :

 

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

 

You can also leverage Target goal conversion Advance settings and select "Increment Count, Release User & Bar from Reentry" . For more details you may refer to this document : https://experienceleague.adobe.com/docs/target/using/activities/experience-targeting/create-targeting/xt-goals-and-settings.html 

Nsingh11Author
Level 2
May 19, 2021
Thanks a lot Gaurav. For some reason profile script did not work for us. We tried to write a function within custom code to set a cookie when user has viewed our pop up, that worked for us.
October 21, 2021

Hello Nsingh, can you please share the custom code you created for this? That would be great as im looking for the same solution. Many thanks!

Gaureshk_Kodag
Adobe Employee
Adobe Employee
May 19, 2021

Hi @nsingh11 

You can create profile script using 

user.isNewSession to return true false value and based on that create audience which u can use in Target activity