is there a way to target the last 48 hours? | Community
Skip to main content
niocolasmeriel
Adobe Employee
Adobe Employee
September 10, 2024
Solved

is there a way to target the last 48 hours?

  • September 10, 2024
  • 2 replies
  • 770 views

I want to target visitors who have been active i.e. surfing on my website during the last 48 hours.

How could this be achieved?

 

thanks

 

Nicolas

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 RiteshY18

may be it not if used with WebSDK or segments are based on the https://experienceleague.adobe.com/en/docs/analytics/components/real-time-reporting/realtime 

2 replies

nnakirikanti
Community Advisor
Community Advisor
September 10, 2024

@niocolasmeriel Given your case we can achieve this with profile scripting in Adobe target and consume the profile script variable in audience to target your activities.

Here the sample code for reference.

var dayInMillis = 24 * 60 * 60 * 1000; // Milliseconds in a day var twoDaysInMillis = 2 * dayInMillis; // Milliseconds in two days // Check if the user has a last activity time stored if (user.getLocal('lastActivityTime')) { var lastActivityTime = user.getLocal('lastActivityTime'); var currentTime = new Date().getTime(); // Calculate the time difference var timeDifference = currentTime - lastActivityTime; // Check if the time difference is less than or equal to two days if (timeDifference <= twoDaysInMillis) { return 'active'; } else { return 'inactive'; } } else { // If no last activity time is stored, set the current time as the last activity time user.setLocal('lastActivityTime', new Date().getTime()); return 'inactive'; }

 

 Let me know if you need more assistance on this.

 

~cheers,

NN.

RiteshY18
Community Advisor
Community Advisor
September 11, 2024

@niocolasmeriel  , apart from the profile script option

  • consider creating a segment using Adobe Analytics where you can create sections for specific pages/visit/visit and apply time constraint: occurs within the last 48 hours as a condition
  • bring in conditional segments from AEP or Audience Manger 
maccg12
Level 3
September 13, 2024

@riteshy18 I thought Adobe Analytics had some kind of delay though?

RiteshY18
Community Advisor
RiteshY18Community AdvisorAccepted solution
Community Advisor
September 16, 2024

may be it not if used with WebSDK or segments are based on the https://experienceleague.adobe.com/en/docs/analytics/components/real-time-reporting/realtime