Running an Experience during a scheduled time period


Convert lets you schedule your experiments or campaigns to start and stop them at specific times. 


Add Moment.js Library

First, you will need to include the moment.js library into your project. You can do this by adding the following line into the Global Project Javascript:

convert.$.getScript("", function(){

  console.log("moment.js has been included.");


It will look like this:


Add JS Condition on Audiences

Now include the following code as a Javascript Condition on your Audience, replacing the date and time shown in bold below with the specific date(s) and time(s) you are targetting:

(function() {
	if (typeof moment == 'undefined') {
	} else {
		return moment().isBetween('2018-01-12 00:00:01', '2018-01-15 23:59:59');

It will look similar to the screenshot below.  Although you cannot see the whole code here, you can copy and paste the above code snippet into notepad or a code editor, modify it as you want and then paste it into the Audience JS condition:

Moment will interpret the date as the user's local computer time, but if you want to specify a time zone or UTC offset or do anything more complex, please refer to the official documentation:

Need assistance? Start a conversation with our Support Team.

Reliably Convert More Site Visitors, Even If Everything Else is Changing in Your Business.

✓ No Credit Card  ✓ Easy Set-Up  ✓ Access All Features