Expand my Community achievements bar.

SOLVED

Segment experiences based on time of day

Avatar

Level 2

In Adobe Target Classic workflow, you had the ability to allow users into an experience based on the time of day.  It was configured as a segment option which could then be applied at either the experience level or campaign level.  Is this ability still part of the new Target Standard?  Is so, can any offer assistance on how to go about setting up an experience targeting campaign that changes based on Time of Day.  We have a product that is being promoted but is only available during certain time so we need to configure the message to align with that scenario.

1 Accepted Solution

Avatar

Correct answer by
Level 2

Thanks for reaching out to Adobe community

You could create a profile script with following code : 

var d = new Date(); return d.getHours();

Then create an audience in a way shown in the attachment (ReturnDayOfWeek is the name of profile script). Please make sure to take into account timezone of your customers with server's timezone.

View solution in original post

7 Replies

Avatar

Correct answer by
Level 2

Thanks for reaching out to Adobe community

You could create a profile script with following code : 

var d = new Date(); return d.getHours();

Then create an audience in a way shown in the attachment (ReturnDayOfWeek is the name of profile script). Please make sure to take into account timezone of your customers with server's timezone.

Avatar

Level 2

Thank you very much! It works just as expected.  Do you know if there is a way to have the script check the time upon every page load? The ideal outcome would be that when the specified time window is not met, it shows the default experience for all audiences.  When the clock turns and the time aligns with the service hours, the experience generates.  

We are finding that the browser cache holds onto the experience timestamp so we must clear the history each to push through the change.

Avatar

Level 2

I just confirmed at my end, for an experience targeting activity profile script values update on every load. And therefore your experience should update when time aligns with service hours. 
Could you please share the URL / activity where you see the experience sticking so I can debug?

Avatar

Level 2

Yes, Thank you.

The experience is specific to MOBILE.  Between 7- 9pm the user has the ability to direct call for the service.  Anything later than 9 pm or earlier in the morning before 7 am, that ability is removed and only an option to learn about the service is shown.

If time is between 7am-9pm: https://www.marshfieldclinic.org/?at_preview=ngFY2q60BNC3Zzs1D086240uQILwur

If time is between 9pm - 7am: https://www.marshfieldclinic.org/?at_preview=OXNj0ptBB7GEIG55wqZAMke2Xx52fe

The test is live at:  https://www.marshfieldclinic.org/?qa=true  Be sure to size browser to less than 480px to see changes

Snapshots of the audience profiles are attached.

Avatar

Level 2

Hi,
I would recommend you to use 'is greater than or equal to' and 'is less than or equal to' in your 7AM-9PM segment.

With the current implementation of segments, when hour of day is 7 or 21, user will see default offer. And, this may be the case when you checked. I have debugged and found that the script is sending the updated value and it should not be a concern.

Currently, 

  • 7-9 daytime segment is effective from 8AM-8PM (due to absence of equal to operator)
  • 9-7 evening segment is effective from 10PM-6AM
  • 0700-0759 hours  and 2100-2159 hours will show default content (not even entering your campaign).

Please make the changes.

Avatar

Level 2

Thank you! You have helped our business take a big leap forward.